Re: [racket-users] Typed Racket guard a binding with an error

2016-12-12 Thread Matthias Felleisen
> On Dec 12, 2016, at 1:31 PM, Alex Knauth wrote: > > #lang typed/racket > > (define ls (port->list read (open-input-string "1 2 3 4"))) > (for ([n (assert ls (λ ([ls : (Listof Any)]) (andmap number? ls)))]) > (displayln (* n n))) > I think this suggests that TR

Re: [racket-users] Typed Racket guard a binding with an error

2016-12-12 Thread Alex Knauth
> On Dec 12, 2016, at 10:40 AM, Winston Weinert wrote: > > Thanks. I wrote a rudimentary syntax transformer, but really I don't know the > best way to work around this -- and I'm not very proficient with syntax > transformers. I could put all of my code which I would

Re: [racket-users] Typed Racket guard a binding with an error

2016-12-12 Thread Winston Weinert
Thanks. I wrote a rudimentary syntax transformer, but really I don't know the best way to work around this -- and I'm not very proficient with syntax transformers. I could put all of my code which I would prefer to be top level in a procedure/let context, but I don't really think this is the

Re: [racket-users] Typed Racket guard a binding with an error

2016-12-12 Thread Sam Tobin-Hochstadt
Typed Racket only follows control flow like you've written inside expressions, not at the top-level of a module. So this program will work correctly: #lang typed/racket (define (f) (define ls (port->list read (open-input-string "1 2 3 4"))) (unless (andmap number? ls) (error "ls not read

[racket-users] Typed Racket guard a binding with an error

2016-12-12 Thread Winston Weinert
Hi, the following code listing gives me this TR error: ; /home/winston/code/practice/snippets/tr.rkt:7:16: Type Checker: type mismatch ; expected: Number ; given: Any ; in: n ; /home/winston/code/practice/snippets/tr.rkt:7:18: Type Checker: type mismatch ; expected: Number ; given: Any