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
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
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,
3 matches
Mail list logo