Re: [racket] Type of argument in a function

2014-07-20 Thread קוראל אלימלך
thank u all!! :) 2014-07-20 16:09 GMT+03:00 קוראל אלימלך : > תודה רבה לכולם :) > עזרתם לי מאוד! > > > 2014-07-20 15:59 GMT+03:00 David Van Horn : > >> On 7/20/14, 7:04 AM, קוראל אלימלך wrote: >> > How can i define that a function will get an integer argument? >> > >> > is its possible? >> > >> >

Re: [racket] Type of argument in a function

2014-07-20 Thread קוראל אלימלך
תודה רבה לכולם :) עזרתם לי מאוד! 2014-07-20 15:59 GMT+03:00 David Van Horn : > 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 >

Re: [racket] Type of argument in a function

2014-07-20 Thread David Van Horn
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 sug

Re: [racket] Type of argument in a function

2014-07-20 Thread Jens Axel Søgaard
#lang typed/racket (: plus : Number Number -> Number) (define (plus x y) (+ x y)) (plus 1 2) (plus "x" 3) 2014-07-20 13:53 GMT+02:00 Jens Axel Søgaard : > #lang racket > > (define (plus x y) > (unless (and (number? x) (number? y)) > (error 'plus (~a "expected two numbers, got: " x " " y

Re: [racket] Type of argument in a function

2014-07-20 Thread Jens Axel Søgaard
#lang racket (define (plus x y) (unless (and (number? x) (number? y)) (error 'plus (~a "expected two numbers, got: " x " " y))) (+ x y)) (plus 1 2) (plus "x" 3) 2014-07-20 13:04 GMT+02:00 קוראל אלימלך : > How can i define that a function will get an integer argument? > > is its possible?

Re: [racket] Type of argument in a function

2014-07-20 Thread dfeltey
AM GMT -05:00 US/Canada Eastern Subject: [racket] Type of argument in a function 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 b

[racket] Type of argument in a function

2014-07-20 Thread קוראל אלימלך
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.. Racket Users list: http://lists.racket-lang.org/users