screwlisp proposes kittens

Common lisp cl-series macro package recursively intern list fringe as symbols

Well, I wanted to use it a minute ago for whatever reason. Macro characters will still have their macro character meanings when they are read using read (the default for series scanners). In this case all that happens is that the numbers get interned as a symbol whose symbol-name is a string of the number.

Cl-series:

Here done interactively in the repl.

(defparameter *list* '((a 1 b 2) (3) 4 (((c)))))
*list*
(require :series)
(series::install)
(scan-lists-of-lists-fringe ***)
(#Mformat (series nil) (series "~a") *)
(#Mintern *)
(alter *** *)
(series::install :remove t)
*list*

Output:

CL-USER> (defparameter *list* '((a 1 b 2) (3) 4 (((c)))))
*LIST*
CL-USER> *list*
((A 1 B 2) (3) 4 (((C))))
CL-USER> (require :series)
NIL
CL-USER> (series::install)
T
CL-USER> (scan-lists-of-lists-fringe ***)
#Z(A 1 B 2 3 4 C)
CL-USER> (#Mformat (series nil) (series "~a") *)
#Z("A" "1" "B" "2" "3" "4" "C")
CL-USER> (#Mintern *)
#Z(A |1| B |2| |3| |4| C)
CL-USER> (alter *** *)
;;; Warning: Restriction violation 5 in series expression:
(ALTER *** *)
Alter applied to a series that is not known at compile time:
(ALTER *** *)
NIL
CL-USER> (series::install :remove t)
T
CL-USER> *list*
((A |1| B |2|) (|3|) |4| (((C))))
CL-USER> 

Conclusions

Series has special measures for still virtually working done incrementally, even though the way it intends to work is that it constructs a graph and writes tight lazy efficient code at (one) macroexpansion. scan-lists-of-lists-fringealter is powerful. alter changes values in the original sequence that was scanned in-place. The fringe is the fringe.

Fin.

See you on the Mastodon.

In the annual lisp tradition, today’s show https://communitymedia.video/w/xnUY9Z6koSooVQUHradmwj with Kent Pitman and Ramin Honary has me reading Kent’s A Christmas Peril after 10 minutes of me having pushed the wrong button to start the stream (again, even after Sunday’s debacle https://toobnix.org/w/dxv8UHoNciHkfRYWXupWu8).

screwlisp proposes kittens