🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.xerox
Article #331

Re: INTERLISP-D TO COMMON LISP MACRO CONVERSION

#331
From: cutting.pa
Date: Mon, 19 Oct 1987 18:17
13 lines
1046 bytes
(defmacro dfexpr (name arglist &body body)
  (let ((%name (gensym (string name))))
    `(prog1
       (defmacro ,name ,arglist
         (list ',%name 
          ,@(mapcar #'(lambda (arg) `(list 'quote ,arg)) arglist)))
       (defun ,%name ,arglist ,@body))))

Note that this won't work if the arglist contains keywords (eg. &rest).
 
In XCL you'd probably want to use:

(defdefiner dfexpr il:functions (name arglist &body body) (let ...))
Technical Details
Message-ID: <871019-111750-6359@Xerox>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!sdcsvax!ucbvax!XEROX.COM!cutting.pa
References: <ADRE%gec-m.rutherford.ac.uk@NSS.Cs.Ucl.AC.UK>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!sdcsvax!ucbvax!XEROX.COM!cutting.pa
From: cutting.pa@XEROX.COM
Newsgroups: comp.sys.xerox
Subject: Re: INTERLISP-D TO COMMON LISP MACRO CONVERSION
Message-ID: <871019-111750-6359@Xerox>
Date: Mon, 19-Oct-87 14:17:00 EDT
Article-I.D.: Xerox.871019-111750-6359
Posted: Mon Oct 19 14:17:00 1987
Date-Received: Tue, 20-Oct-87 21:23:27 EDT
References: <ADRE%gec-m.rutherford.ac.uk@NSS.Cs.Ucl.AC.UK>
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The ARPA Internet
Lines: 13