Re: How to use constants in a case key form ?
- From: Geoff Wozniak <geoff.wozniak@xxxxxxxxx>
- Date: Fri, 23 Nov 2007 10:39:46 -0800 (PST)
On Nov 23, 1:20 pm, Frank Goenninger DG1SBG <dont-email...@xxxxxxxxxx>
wrote:
So far so bad. I have a real bunch of defconstants (about 200)
so... How do I get to use theconstantsin mycasekey forms?
One way is to write your own case macro. Another is to evaluate the
constants at read time.
CL-USER> (defconstant +first+ 1)
+FIRST+
CL-USER> (let ((x 1))
(case x
(#.+first+ 'first!)
(t 'something-else!)))
FIRST!
This assumes that the constants are available when the case form is
read. It also assumes you recompile the forms that depend on the
constants if you change the constants.
The discussion "Putting evaluated constants in a CASE" from 2004 in
this newsgroup may be helpful.
.
- Follow-Ups:
- Re: How to use constants in a case key form ?
- From: Zach Beane
- Re: How to use constants in a case key form ?
- References:
- How to use constants in a case key form ?
- From: Frank Goenninger DG1SBG
- How to use constants in a case key form ?
- Prev by Date: Re: Doing the unthinkable?
- Next by Date: Re: How to use constants in a case key form ?
- Previous by thread: Re: How to use constants in a case key form ?
- Next by thread: Re: How to use constants in a case key form ?
- Index(es):
Relevant Pages
|