Search found 2 matches

by dynamic
Thu Sep 15, 2011 2:47 am
Forum: Common Lisp
Topic: pop puzzle
Replies: 2
Views: 3629

Re: pop puzzle

Thank you for your answer and pointers to defsetf and define-setf-expander. I will study it.
by dynamic
Wed Sep 14, 2011 2:51 pm
Forum: Common Lisp
Topic: pop puzzle
Replies: 2
Views: 3629

pop puzzle

Hello Lispers! It is usually said that (pop stack) is equivalent of (prog1 (first stack) (setf stack (rest stack))) or (let ((elt (first stack))) (setf stack (rest stack)) elt). I don't understand why the following function doesn't work as an equivalent of built-in pop: (defun my-pop (lst) (let ((x ...