Re: unboxed structure fields (or class slots)
"Tim Bradshaw (as tfb at cley dot com)" <[email protected]>
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
On 12 Jan 2026, at 21:30, wojciech.pasieka (as wojciech dot pasieka at ai dot pressiton dot com) <[email protected]> wrote: > > (DEFUN arc-transformer-1 (input-facts) > (LET* ((colors '(C O F N)) > (objects (MAPCAR (LAMBDA (col) (REMOVE-IF-NOT (LAMBDA (p) (EQ (THIRD p) col)) input-facts)) > colors)) > > (object-data (MAPCAR (LAMBDA (obj) (LET ((cols (MAPCAR #'SECOND obj))) > (LIST :color (THIRD (CAR obj)) > :width (1+ (- (REDUCE #'MAX cols) (REDUCE #'MIN cols)))))) > objects)) > > (sorted-objects (STABLE-SORT (COPY-LIST object-data) #'> :KEY (LAMBDA (x) (GETF x :width)))) > > (final-output (LOOP FOR obj IN sorted-objects FOR row-idx FROM 0 > COLLECT (LOOP FOR col-idx FROM 0 TO (1- (GETF obj :width)) > COLLECT (LIST row-idx col-idx (GETF obj :color)))) ) ) > > final-output)) This should be the point in the plot where the protagonists realise that the terrifying slave army which is meant to replace them solve all their problems by unexplained magic is armed with swords made of damp cardboard with the word 'sword' written on them, apparently in green crayon and often spelled incorrectly. But it's not a movie: the protagonists will continue to believe that the slave army is a terrifying threat on their side and pay the vast dues it demands for its worthless services. --tim