Re: [racket-users] syntax woe with typed Racket 'let'

2020-06-02 Thread Philip McGrath
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 message

Re: [racket-users] syntax woe with typed Racket 'let'

2020-06-01 Thread Hendrik Boom
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 u

Re: [racket-users] syntax woe with typed Racket 'let'

2020-06-01 Thread Shu-Hung You
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: > >

Re: [racket-users] syntax woe with typed Racket 'let'

2020-06-01 Thread Sam Tobin-Hochstadt
The syntax looks like this: (define (f [x : Number] . [y : String *]) : Number (+ x (length y))) See the documentation for `define` in Typed Racket here: https://docs.racket-lang.org/ts-reference/special-forms.html?q=define#%28form._%28%28lib._typed-racket%2Fbase-env%2Fprims..rkt%29._define%29%29

Re: [racket-users] syntax woe with typed Racket 'let'

2020-06-01 Thread Hendrik Boom
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 D

Re: [racket-users] syntax woe with typed Racket 'let'

2020-06-01 Thread Sam Tobin-Hochstadt
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 (and

[racket-users] syntax woe with typed Racket 'let'

2020-05-30 Thread Hendrik Boom
I'm sorry to keep pestering this list, but I'm out of my depth with the detailed syntax (and semantics) of typed Racket. But I'm doggedly ploughing on. I'm having trouble with the 'let' line in the 'pointer-to' function listed later: (let ([vt : Ffi-type (cast ((inst hash-ref Ffi-type Ffi-typ