Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!rutgers!mit-eddie!uw-beaver!ssc-vax!bcsaic!lbaum From: lbaum@bcsaic.UUCP (Larry Baum) Newsgroups: comp.lang.lisp Subject: Re: Amusing Code Message-ID: <7209@bcsaic.UUCP> Date: 24 Aug 88 16:01:29 GMT References: <389@soi.UUCP> Reply-To: lbaum@bcsaic.UUCP (Larry Baum) Organization: Boeing Computer Services AI Center, Seattle Lines: 22 In article <389@soi.UUCP> alex@soi.UUCP (Alex Zatsman) writes: > >(defvar *Stack*) > >(defun Push-Object (Object) (push Object (car *Stack*))) > >(defun Init-Stack () (setf *Stack* '((:Bottom-Frame)))) > >(defun Test-Stack () > (Init-Stack) (print *Stack*) > (Push-Object 11) (print *Stack*) > (Init-Stack) (print *Stack*) (values)) > This is another in a long series of examples that show the danger in using quoted lists instead of the LIST function, and also using "destructive" operations such as PUSH. Of course the "correct" code should do: (defun Init-Stack () (setf *Stack* (list '(:Bottom-Frame)))) LSB