On Mon, Jun 1, 2020 at 3:48 PM Sam Tobin-Hochstadt
wrote:
> (define (f [x : Number] . [y : String *]) : Number (+ x (length y)))
>
Another way to write this, which I often prefer, is:
> (: f (-> Number String * Number))
> (define (f x . y)
> (+ x (length y)))
>
--
You received this
On Mon, Jun 01, 2020 at 10:28:55PM -0500, Shu-Hung You wrote:
> FWIW, because `.` is just cons, the program
> (define (F [X : T1] . [Y : T2]) 'e)
> is being read as:
> (define (F [X : T1] Y : T2) 'e)
> I guess that's the reason for having an extra '*' in the syntax.
Indeed. It works for
FWIW, because `.` is just cons, the program
(define (F [X : T1] . [Y : T2]) 'e)
is being read as:
(define (F [X : T1] Y : T2) 'e)
I guess that's the reason for having an extra '*' in the syntax.
On Mon, Jun 1, 2020 at 10:16 PM Sam Tobin-Hochstadt
wrote:
>
> The syntax looks like this:
>
The syntax looks like this:
(define (f [x : Number] . [y : String *]) : Number (+ x (length y)))
See the documentation for `define` in Typed Racket here:
On Mon, Jun 01, 2020 at 10:58:09AM -0400, Sam Tobin-Hochstadt wrote:
> Do you perhaps have some other binding shadowing the binding of `:`
> from Typed Racket? That produces the error message you get when I try
> it.
Not intentionally. I'll have to look carefully for possible candidates.
Or ask
Do you perhaps have some other binding shadowing the binding of `:`
from Typed Racket? That produces the error message you get when I try
it.
Sam
On Sat, May 30, 2020 at 1:32 PM Hendrik Boom wrote:
>
> I'm sorry to keep pestering this list, but I'm out of my depth with the
> detailed syntax
6 matches
Mail list logo