Elektrine lite

← Feed

@vnikolov@ieji.de

Post #2369172

2026-05-01 21:24 UTC

I wrote: «It seems to me that it would be interesting to fix (LOOP COLLECT X FOR X FROM 3 TO 5) (3 4 5 6) rather than prohibit it, _but_ it may be difficult to justify the effort.» NB: this is not just about fixing the implementation. First of all, the specification would become too complicated, to say the least, because clauses in declarative style have to coexist with clauses with side effects. For the former, order shouldn't matter, but for the latter it must. Otherwise, it is very tempting to have the above syntax, as it resembles {x l x ∈ 𝐙, 3 ≤ x ≤ 5} «Regrettably, I can't recall exactly what the _current_ Common Lisp specification says, but I'll check later.» Yes, it is prohibited indeed. The syntax is loop [name-clause] {variable-clause}* {main-clause}* => result* and a "for-as" clause is a variable clause, while an accumulation is a main clause. [CLHS: Macro LOOP ] #CommonLisp @kentpitman@climatejustice.social @screwlisp@gamerplus.org

Replies (0)

No replies.