home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!ames!think.com!barmar
- From: barmar@think.com (Barry Margolin)
- Newsgroups: comp.lang.lisp
- Subject: Re: local macro definitions
- Date: 27 Jul 1992 19:22:39 GMT
- Organization: Thinking Machines Corporation, Cambridge MA, USA
- Lines: 29
- Distribution: comp.lang.lisp
- Message-ID: <151idvINN6mn@early-bird.think.com>
- References: <4133@inca.comlab.ox.ac.uk>
- NNTP-Posting-Host: telecaster.think.com
-
- In article <4133@inca.comlab.ox.ac.uk> gordon@robots.oxford.ac.uk (Gordon Buxton) writes:
- >3. Bind each of the slot names to a macro (macrolet ... ?) that then
- >gets expanded to (val self '<slot-name>) upon execution.
-
- If I understand you, this seems like the right thing. The name of the
- special form is SYMBOL-MACROLET, and it was invented for use by CLOS for
- pretty much the same thing you're doing with your frames (e.g.
- WITH-ACCESSORS and WITH-SLOTS expand into SYMBOL-MACROLET forms).
-
- >-- This is the one I like best, but there are two problems:
- > a) The user-code function call is already constructed using the
- > backquote - I'd have to expand macros within this.
-
- This shouldn't be necessary. It's hard to say for sure, but the right
- macro and symbol-macro expansions should all occur automatically.
-
- > b) I don't know how to do it, or if it is possible
-
- (symbol-macrolet ((<slot-1> (val self '<slot-1>))
- (<slot-2> (val self '<slot-2>))
- ...)
- <code that references <slot-N> as variables>)
-
- See CLtL2 for more details.
- --
- Barry Margolin
- System Manager, Thinking Machines Corp.
-
- barmar@think.com {uunet,harvard}!think!barmar
-