Re: portable detection of special symbols?
- From: Pascal Costanza <pc@xxxxxxxxx>
- Date: Sat, 23 Apr 2011 22:46:23 +0200
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
--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
The views expressed are my own, and not those of my employer.
.
- Follow-Ups:
- References:
- portable detection of special symbols?
- From: D Herring
- 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
|