Re: [racket-users] for/vector with accumulator?

2016-03-12 Thread John Berry
For Heresy, I got to thinking about all the different special for loops in Racket, and how I could generalize them into a single form, and what I realized is that all you need for that is to just build in an accumulator. Every for loop in Heresy contains the inbuilt variable "cry", which is a

Re: [racket-users] for/vector with accumulator?

2016-03-11 Thread Matthias Felleisen
Three observations: 1. The counter-argument to the RnRS quotation would be that for/vector/accum is that it expands into a plain old use of the same feature, because "it's just a macro." 2. People designed all kinds of 'loops' in the 70s to find just the right one: for/while/repeat/do and

[racket-users] for/vector with accumulator?

2016-03-11 Thread 'John Clements' via Racket Users
Often, mutation provides “obvious” ways to do things that may be more difficult to do without it. Here’s one that I came across today: for/vector with an accumulator. In this case, I want to create an array of length ’n’ where each cell contains a list of n copies of the symbol ‘zzz. That is,