[LispM-Hackers] {CAR,CDR}-{SYM,NUM}-MODE

James A. Crippen james@unlambda.com
20 Dec 2001 23:24:15 -0900


The subject heading is perhaps a bit abstruse.  I was just looking at
the SavedMFlags field in the dump of the first stack group:

  SavedMFlags          0a020422 = CDR_CODE=NORMAL;DTP=FIX;POINTER=20422
                       QBBFL: false - xyzzy
                       CAR-SYM-MODE: 1 - error except (CAR NIL) is NIL
                       CAR-NUM-MODE: 0 - error
                       CDR-SYM-MODE: 1 - error except (CDR NIL) is NIL
                       CDR-NUM-MODE: 0 - error
                       DONT-SWAP-IN: false
                       TRAP-ENABLE: false
                       MAR-MODE: read-trap=false; write-trap=false
                       PGF-WRITE: false
                       INTERRUPT-FLAG: false
                       SCAVENGE-FLAG: false
                       TRANSPORT-FLAG: false
                       STACK-GROUP-SWITCH-FLAG: false
                       DEFERRED-SEQUENCE-BREAK-FLAG: true
                       METER-ENABLE: false
                       TRAP-ON-CALL: false

What I was thinking about was the lines CAR-SYM-MODE, CDR-SYM-MODE,
etc.  I'm not sure but I have a hunch that these are related to how
locatives are treated with car and cdr...  In other words, if
CAR-SYM-MODE is 1 then as the note says the car of any symbol (not of
a cons, but a _symbol_, which of course has no car or cdr) will cause
an error, except that (CAR NIL) will return NIL.  The same applies to
numbers.

I still have no idea exactly why you might want the car of a symbol to
return something else, but I venture a guess that if you take the cdr
of a symbol you'll get a locative.  ISTR that's the way that they work
on Symbolics lispms.  I might be mistaken though, having never needed
such a thing.

'james

-- 
James A. Crippen <james@unlambda.com> ,-./-.  Anchorage, Alaska,
Lambda Unlimited: Recursion 'R' Us   |  |/  | USA, 61.20939N, -149.767W
Y = \f.(\x.f(xx)) (\x.f(xx))         |  |\  | Earth, Sol System,
Y(F) = F(Y(F))                        \_,-_/  Milky Way.