Re: [racket-dev] Make range cooperate with for loops?

2017-01-04 Thread Matthew Butterick
> On Jan 4, 2017, at 2:47 PM, Gustavo Massaccesi wrote: > > I'm not sure that it's so easy. The transformation must ensure that > this program works correctly: Oh, I didn't say it was easy. Macro mischief: always with us. #lang racket (define-syntax-rule (range x ...)

Re: [racket-dev] Make range cooperate with for loops?

2017-01-04 Thread Gustavo Massaccesi
I'm not sure that it's so easy. The transformation must ensure that this program works correctly: #lang racket (define-syntax-rule (#%datum . x) '(2 2 2)) (for ([i 5]) (displayln i)) Gustavo On Wed, Jan 4, 2017 at 7:17 PM, Matthew Butterick wrote: > > On Jan 3, 2017, at

Re: [racket-dev] Make range cooperate with for loops?

2017-01-03 Thread Robby Findler
Go for it!! Robby On Tue, Jan 3, 2017 at 12:49 PM, Alexis King wrote: > A question[1] was asked on Stack Overflow today that used `range` from > racket/list in a for loop, then was baffled as to why it was so slow compared > to a manually written loop using named let.

[racket-dev] Make range cooperate with for loops?

2017-01-03 Thread Alexis King
A question[1] was asked on Stack Overflow today that used `range` from racket/list in a for loop, then was baffled as to why it was so slow compared to a manually written loop using named let. To some extent, confusion of this sort is unavoidable, since it stems from a confusion about the