Re: [racket-dev] sequence syntax for (mlist #t #f …) ?

2012-06-21 Thread John Clements
On Jun 21, 2012, at 1:34 AM, Robby Findler wrote: > I usually in-naturals and zero? to do this. Ah! That's nice. I can use that. > > I see that one example (that I didn't write is in base-render.rkt > >(define/public (render-nested-flow i part ri starting-item?) > (for/list ([b (in-l

Re: [racket-dev] sequence syntax for (mlist #t #f …) ?

2012-06-21 Thread John Clements
On Jun 21, 2012, at 1:24 AM, Eli Barzilay wrote: > An hour and a half ago, John Clements wrote: > > >> Yes, of course I can do it the ugly way: >> [...] >> (define p1 (mcons #f 'bogus)) >> (set-mcdr! p1 p1) >> (define true-then-falses (mcons #t p1)) > > What about > > (shared ([fs (cons #f f

Re: [racket-dev] sequence syntax for (mlist #t #f …) ?

2012-06-21 Thread Eli Barzilay
A few minutes ago, Robby Findler wrote: > I usually in-naturals and zero? to do this. (Ah, I forgot to include this, with the observation that worrying about bignums is not relevant...) > I see that one example (that I didn't write is in base-render.rkt > > (define/public (render-nested-flo

Re: [racket-dev] sequence syntax for (mlist #t #f …) ?

2012-06-21 Thread Robby Findler
I usually in-naturals and zero? to do this. I see that one example (that I didn't write is in base-render.rkt (define/public (render-nested-flow i part ri starting-item?) (for/list ([b (in-list (nested-flow-blocks i))] [pos (in-naturals)]) (render-block b part r

Re: [racket-dev] sequence syntax for (mlist #t #f …) ?

2012-06-21 Thread Eli Barzilay
An hour and a half ago, John Clements wrote: > Reality check before I do something dumb and re-invent the wheel: > > I often want to write a for loop where the first element is treated > specially. In such cases, it would be nice to have a sequence that > had a #t and then an infinite number of #f

[racket-dev] sequence syntax for (mlist #t #f …) ?

2012-06-20 Thread John Clements
Reality check before I do something dumb and re-invent the wheel: I often want to write a for loop where the first element is treated specially. In such cases, it would be nice to have a sequence that had a #t and then an infinite number of #f's, so I could write (for ([s my-sequence] [first? ]