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

Re: generalization of PUSH



say that there was a GENERAL-PUSH macro, such that

(defmacro PUSH (C L) `(GENERAL-PUSH CONS ,C ,L))

;; As a matter of fact, it looks like you could trivialy
;; change NILCOM;SETF's definition of +INTERNAL-PUSH-X to
;; be general in this manner.

;; then I could define a favourite macro 

(defmacro INC (X) `(GENERAL-PUSH PLUS 1 ,X))

;; It would be very nice to be able to do this,
;; since otherwise I have to
;; (1) Go through all the multiple-evaluation preventing hair
;;     that you have already figured out.
;; OR
;; (2) Do it wrong, possibly being screwed by multiple evaluations
;; at some later date.

-GJC

p.s. POP is a candidate too, just by making CAR/CDR be
parameters. Together these would be nice for stack implementations
using arrays & other things.

I've got a hacked version of NILCOM;SETF on my dir,
and it works like a charm (in the compiler).