The problem is it's a walled garden, with its own quirky syntax; nothing that happens inside of loop is applicable outside, and the other way around.
The abstractions used in Calendrical Calculations sound good - and echo what I've seen elsewhere - so, based on your comment I'm now more likely to read it, so thank you for that.
The source code is available there.
Trivial example of breakage:
(iter (for i from 1 to 10)
(print (count i some-sequence)))Or is the documentation wrong?
Iterate, in (COUNT I SOME-SEQUENCE): Missing value for SOME-SEQUENCE keyword
as well as WARNING:
COUNT appears to be used as an ITERATE clause keyword, in this sexpression: (COUNT I SOME-SEQUENCE).
This use is now deprecated and will cease to be supported in a future version. Please use the alternative keyword COUNTING instead. If you intended COUNT to be interpreted as a function call, instead of an ITERATE clause, you must find an alternative way of calling it, at present, perhaps by using FUNCALL or APPLY.
Have to use (iter (for i from 1 to 10)
(print (funcall #'count i some-sequence)))
Guess the documentation /is/ wrong (for now, until the code finishes catching up)But yeah, that's still not something I intend to use if they make you work around what should be plain Common Lisp.
(Using a literal list or vector gives a different error)
Still better than the loop abomination, IMO.
I had to rub my own eyes to believe that such a thing is possible.
It comes with over twenty useful clauses. Clauses are programmer-definable.
Clauses can combine in parallel or nested/cross-product iteration.
Then you got all the life-improving goodies (in-{sequence,string,file,stream}, index-of-*, previous, etc...) that really add up to something.