[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SETF losing on FIX-I stuff...



(MACROEXPAND '(SETF (FIXNUM-IDENTITY (CAR X)) Y))

  => (PROGN (FIXNUM-IDENTITY (RPLACA X Y)) Y)

This seems to me to be a bit silly... I suspect it means that the recursive
relation you are using to do expansions in general has a bug in it ... whatever
mechanism you use should see to it that the FIXNUM-IDENTITY is held to the
outside... I don't really understand why it doesn't just return

  (FIXNUM-IDENTITY (SETF (CAR X) Y))

and then let the SETF inside get expanded later. That would assure that later
an independent macroexpansion would leave you with the form

  (FIXNUM-IDENTITY (PROGN (RPLACA X Y) Y))

which is what I think ought to be returned ... I still question whether

(SETF (FIXNUM-IDENTITY x) y) shouldn't turn into 
(FIXNUM-IDENTITY (SETF x (FIXNUM-IDENTITY y)))

since in the case of GJC's generalization of PUSH/POP, it might be useful
to know the typep of the value being put into the slot ... 
-kmp