elisp の push に絶望したッ!

絶望したッ! elisp の push がリストの末尾ではなく先頭に要素を追加することに絶望したッ!それじゃ unshift じゃないかッ!

; OK。でも (d a b c) というリストになる。
(setq x '(a b c))
(push 'd x)

; OK。これがやりたかっただけなのに…。 
(append x '(d))

push が引数にリストを取れないことにも絶望したッ!

; NG。push はリストを引数にとれない。
(push 'd '(a b c))

M-x help f push より抜粋。

push is a Lisp macro in `cl.el'.
(push x place)

Insert x at the head of the list stored in place.
Analogous to (setf place (cons x place)), though more careful about
evaluating each argument only once and in the right order.  place may
be a symbol, or any generalized variable allowed by `setf'.

なんとなく、言い回しを使いたかったので。本当は、へぇーと思っただけデス。(^-^;

さよなら絶望先生(2) (講談社コミックス)

さよなら絶望先生(2) (講談社コミックス)