[racket] Type of argument in a function
thank u all!! :)
2014-07-20 16:09 GMT+03:00 קוראל אלימלך <coral2301 at gmail.com>:
> תודה רבה לכולם :)
> עזרתם לי מאוד!
>
>
> 2014-07-20 15:59 GMT+03:00 David Van Horn <dvanhorn at cs.umd.edu>:
>
>> On 7/20/14, 7:04 AM, קוראל אלימלך wrote:
>> > How can i define that a function will get an integer argument?
>> >
>> > is its possible?
>> >
>> > for example:
>> > (define (func (x::Number))) /// its not working that way
>> >
>> > and if ill call the function with string there will be an error..
>>
>> In addition to the suggestions to use Typed Racket, you may also want to
>> read about contracts:
>>
>> (define/contract (f x) (-> integer? integer?)
>> (* x x))
>>
>> http://docs.racket-lang.org/guide/contracts.html
>>
>> David
>>
>>
>>
>> ____________________
>> Racket Users list:
>> http://lists.racket-lang.org/users
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140720/d6a8f852/attachment-0001.html>