A portable way to tell if a variable is declared special globally
From: Yuji Minejima (ggb01164_at_nifty.ne.jp)
Date: 08/27/04
- Next message: Rich Teer: "Re: Larry Wall & Cults"
- Previous message: George Neuner: "Re: Larry Wall & Cults"
- Next in thread: Iain Little: "Re: A portable way to tell if a variable is declared special globally"
- Reply: Iain Little: "Re: A portable way to tell if a variable is declared special globally"
- Reply: Pascal Costanza: "Re: A portable way to tell if a variable is declared special globally"
- Reply: Vassil Nikolov: "Re: A portable way to tell if a variable is declared special globally"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 27 Aug 2004 14:13:00 +0900
Hi, all
Is there a portable way to tell if a variable is declared special
globally?
My first shot is the following.
(defun special-variable-p (symbol)
(assert (symbolp symbol))
(let ((marker (gensym)))
(eval `(flet ((special-p ()
(and (boundp ',symbol) (eq ,symbol ',marker))))
(and (not (constantp ',symbol))
(let ((,symbol ',marker))
(special-p)))))))
This can't distinguish whether it is declared special globally or locally.
And the variable is once bound to a gensymed symbol, which might cause any
trouble if the variable is one of those used by the system like *package*.
Is there any better way to do it?
Regards,
Yuji.
- Next message: Rich Teer: "Re: Larry Wall & Cults"
- Previous message: George Neuner: "Re: Larry Wall & Cults"
- Next in thread: Iain Little: "Re: A portable way to tell if a variable is declared special globally"
- Reply: Iain Little: "Re: A portable way to tell if a variable is declared special globally"
- Reply: Pascal Costanza: "Re: A portable way to tell if a variable is declared special globally"
- Reply: Vassil Nikolov: "Re: A portable way to tell if a variable is declared special globally"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]