Re: portable detection of special symbols?
- From: RG <rNOSPAMon@xxxxxxxxxxx>
- Date: Sat, 23 Apr 2011 14:01:17 -0700
In article <91gs4vF3hpU1@xxxxxxxxxxxxxxxxxx>,
Pascal Costanza <pc@xxxxxxxxx> wrote:
On 23/04/2011 22:31, Pascal Costanza wrote:
On 23/04/2011 21:07, D Herring wrote:
Special Operator SYMBOL-MACROLET:
"symbol-macrolet signals an error if a special declaration names one of
the symbols being defined by symbol-macrolet"
Is there a better way not requiring the cltl2 environment interface?
Thanks,
Daniel
(defun specialp (symbol)
(eval `(let ((,symbol 0))
(zerop (funcall (let ((,symbol 1))
(lambda () ,symbol)))))))
The following is a variant that moves some code out of the part
evaluated at runtime:
(defun specialp (symbol)
(progv (list symbol) '(0)
(zerop (funcall (eval `(let ((,symbol 1))
(lambda () ,symbol)))))))
Pascal
Doesn't work:
? (defconstant x 1)
X
? (defun specialp (symbol)
(progv (list symbol) '(0)
(zerop (funcall (eval `(let ((,symbol 1))
(lambda () ,symbol)))))))
SPECIALP
? (specialp 'x)
Error: (X) is not a proper list of bindable symbols of length < 169.
rg
.
- Follow-Ups:
- Re: portable detection of special symbols?
- From: Pascal Costanza
- Re: portable detection of special symbols?
- References:
- portable detection of special symbols?
- From: D Herring
- Re: portable detection of special symbols?
- From: Pascal Costanza
- Re: portable detection of special symbols?
- From: Pascal Costanza
- portable detection of special symbols?
- Prev by Date: Re: portable detection of special symbols?
- Next by Date: Re: flet vars
- Previous by thread: Re: portable detection of special symbols?
- Next by thread: Re: portable detection of special symbols?
- Index(es):
Relevant Pages
|