🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #99049

macroexpand bug

#99049
From: Hallvard B Furuseth
Date: Tue, 04 Dec 1990 16:08
27 lines
1420 bytes
Emacs-18.55 on sun3.

Macroexpand does not expand "macros" of the form (NAME . SYMBOL) in
its ENVIRONMENT argument.  I discovered it because my bytecomp
compiles ((macro . SYMBOL) ARGS) forms wrongly.
It does recognize NAME though; NAME's function definition is ignored.

Example:

  (defmacro foo (x) (1- x))
  ==> foo				; OK
  (macroexpand '(foo 0) '((foo . 1+)))
  ==> (foo 0)				; Wrong
  (macroexpand '(foo 0) (list (cons 'foo (symbol-function '1+))))
  ==> 1					; OK
  (macroexpand '(foo 0))
  ==> -1				; OK

It works OK if you replace identity with #<subr identity> or (lambda (x) x).


BTW, backquote does not like such macro calls either.
(` ((macro . identity) 2))
==> Wrong type argument: listp, identity


			Hallvard
Technical Details
Message-ID: <9012041608.AAherteit01156@herteit.ifi.uio.no>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!peregrine!elroy.jpl.nasa.gov!usc!cs.utexas.edu!tut.cis.ohio-state.edu!IFI.UIO.NO!hallvard

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,f91d7e8c2c5be03,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-12-04 08:08:28 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!peregrine!elroy.jpl.nasa.gov!usc!cs.utexas.edu!tut.cis.ohio-state.edu!IFI.UIO.NO!hallvard
From: hallvard@IFI.UIO.NO (Hallvard B Furuseth)
Newsgroups: gnu.emacs.bug
Subject: macroexpand bug
Message-ID: <9012041608.AAherteit01156@herteit.ifi.uio.no>
Date: 4 Dec 90 16:08:28 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 27
Approved: bug-gnu-emacs@prep.ai.mit.edu
Posted: Tue Dec  4 17:08:28 1990