Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version nyu B notes v1.5 12/10/84; site csd2.UUCP
Path: utzoo!linus!philabs!cmcl2!csd2!martillo
From: martillo@csd2.UUCP (Joachim Martillo)
Newsgroups: net.lang.lisp
Subject: Re: HELP: a bug in my lisp interpreter!
Message-ID: <3120004@csd2.UUCP>
Date: Tue, 13-Aug-85 14:58:00 EDT
Article-I.D.: csd2.3120004
Posted: Tue Aug 13 14:58:00 1985
Date-Received: Thu, 15-Aug-85 00:32:24 EDT
References: <16700002@uiucuxc>
Organization: New York University
Lines: 44

Original article follows.  

This is not necessarily  a bug.  I do not   know what dialect  of lisp
you are using but in  many lisps (e.g.  Common  Lisp) the actual point
at   which  a macro  expansion  is  supposed  to   replace  the  macro
invocation  is   unspecified.   Apparently    this  dialect   of  lisp
substitutes the expansion  for the macro call at  the first invocation
of eval on the form.


/* csd2:net.lang.lisp / chandra@uiucuxc.Uiuc.ARPA / 10:32 am  Aug  8, 1985 */

		HELP:	A strange Bug!

I got an exprimental lisp from a friend to play with. It has 
a strange bug.
Here is a session which illustrates the bug. Notice how
the variable foo gets changed after the eval is called.

==>   (defun test macro (args) `(cdr  (quote ,(cadr args))))
test

==>   (test   (a b c d))
  (b c d)

==>   (setq foo '(test   (a b c d)))
  (test   (a b c d))

==>   (eval foo)
  (b c d)

==> foo
  (cdr '(a b c d))

; why did the foo change? I tried the same thing in real MAClisp and Franz
; and the value of foo was retained and was not changed.

; Have you got any idea what went wrong?

Thank you 
Navin Chandra
(to reply: please post a response on the net.lang.lisp, mail never 
really seems to  reach me)
/* ---------- */