Elektrine lite

← Feed

@vnikolov@ieji.de

Post #2369171

2026-05-01 07:55 UTC

@kentpitman@climatejustice.social Thank you! Indeed your post is a good read and instructive on many counts. Three notes: (1) «===== (LOOP FOR X FROM 3 TO 5 COLLECT X) (3 4 5) (LOOP COLLECT X FOR X FROM 3 TO 5) (3 4 5 6) =====» This is an important example (and a good catch), which has "procedural" written all over it and it shows that `loop' isn't actually declarative—it can only be viewed as such, carefully. It seems to me that it would be interesting to fix the second case, rather than prohibit it, _but_ it may be difficult to justify the effort. (Regrettably, I can't recall exactly what the _current_ Common Lisp specification says, but I'll check later.) (2) Yes, I have always found the design and history of the pathname system very instructive, in more ways than I can elaborate now. And let no one forget about logical pathnames, too. "LOSSAG" fit in a single 36-bit word, didn't it? As a footnote, a long time ago I was something of a user of old IBM mainframe operating systems like VM/370¹, which did not have directories and separated a file name from a file type with a space (each up to eight characters, no lower case). _________ ¹ Bulgaria was lagging behind the technological times then. (3) It's interesting to mention an emulator in this context. I can see a weak analogy to historical reconstructions. (There are many people who do them, mostly as recreation. I have been to some, watching horse riders shoot arrows and sheltering in a 7th-century-model tent from the rain.) #CommonLisp #ComputerHistory #DeclarativeProgramming #DeclarativeStyle #History #Lisp #ProceduralProgramming #ProceduralStyle @screwlisp@gamerplus.org

Replies (1)

  • @vnikolov@ieji.de 2026-05-01 21:24

    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

    Open ##2369172