Elektrine lite

← Feed

@kentpitman@climatejustice.social

Post #2369170

2026-04-30 21:21 UTC

@vnikolov@ieji.de @screwlisp@gamerplus.org Well, speaking of primary sources, one of those curious oddities is that I just went back in time to an ITS emulator and was rummaging my personal directory from so many decades before, since many of my files are preserved as part of the emulator. In the file KMP;AR1:LOOP LOSSAG I had collected some issues with LOOP of the time, and one of them was this: ===== (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) ===== But there's always a freshness date on these things, I guess, because I went to a Lisp on the emulator and tested it interactively and saw a different behavior, so I guess later versions (hard to say when) even of that LOOP macro were made to make rules against that because many felt it would be unintuitive to have those differ. ===== lisp↑K LISP 2156 Alloc? n * (LOOP FOR X FROM 3 TO 5 COLLECT X) ;Loading LOOP 819 ;Loading DEFMAX 98 (3 4 5) (LOOP COLLECT X FOR X FROM 3 TO 5) ;(FOR X FROM 3) Iteration is not allowed to follow body code ;BKPT *RSET-TRAP ===== Not really related, but for anyone trying to understand a filename like "KMP;AR1:LOOP LOSSAG" the way to read ITS filenames is in four parts. The directory name, if present, is semicolon-terminated so can appear anywhere among the name tokens. The device name is colon-terminated and likewise can appear anywhere among the name tokens. The other two tokens are two parts of a filename, often called fn1 and fn2. The fn2 is separated by a space, but usually would default, and often to ">", which you can read as "newest version" because an FN2 is either the version or the file type, but isn't both. So "FOO BAR" is a file FOO with type BAR, but "FOO 2" is file FOO with no type but a version 2. And this file in question you could sort of read as /dev/ar1/kmp/loop.lossage except that the device, such as it is, is within my directory, not global to the file system. It's there because I have a file called "AR1 LSPDOC", which is an archive file (I guess kind of like a tar file) that can be accessed as an additional directory level since otherwise all filenames on ITS are at toplevel (and there can be only 512 of those, shared among all users). It was an odd file system, and for Common Lisp users this may help you underestand why the pathname system is so complicated. In fact, the conventional naming for this in lisp was '((ar1 kmp) loop lossage) to work around the syntax, and to be portable to the TOPS-20 operating system, which also ran on a PDP-10 class machine, but which would have named that file as AR2:FOO.LOSSAGE;0 or some such version, since it had both names and versions.

Replies (2)

  • @vnikolov@ieji.de 2026-05-01 07:55

    @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

    Open ##2369171

  • @vnikolov@ieji.de 2026-05-01 08:34

    P.S. @kentpitman@climatejustice.social wrote: «===== (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) =====» Note the choice or accident: 3² + 4² = 5² 3³ + 4³ + 5³ = 6³ @screwlisp@gamerplus.org

    Open ##2369173