[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

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

Re: [racket-users] errortrace requires 10x time and memory for the program to compile

2016-12-12 Thread Dmitry Pavlov
Matthew, On 12/10/2016 06:22 PM, Matthew Flatt wrote: At Mon, 5 Dec 2016 10:19:03 -0700, Matthew Flatt wrote: There's a pending issue of making sure that `for` loops or other things are not needlessly instrumented, since they're only part of the expansion instead of the original code. We

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 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 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

[racket-users] Re: syntax-property lost across module boundary (WAS: format-id doesn't preserve preserved?-edness of syntax-property?)

2016-12-12 Thread 'William J. Bowman' via Racket Users
Ah, thanks. Anyone else have other ideas for problems using syntax-properties, or maybe make-rename-transformers (with not-free-identifier=?), across modules? -- William J. Bowman On Sun, Dec 11, 2016 at 07:54:29PM -0500, Alex Knauth wrote: > > > On Dec 11, 2016, at 7:20 PM, 'William J.