Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Lisp > Re: Any program...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 8 Topic 12466 of 13402
Post > Topic >>

Re: Any programmable way to ask whether a symbol has been proclaimed

by jcornez@[EMAIL PROTECTED] May 16, 2008 at 06:57 AM

Something simpler ought to be possible.  How about this?

(defun special-p (symbol)
  (if (constantp symbol)
      t ;; or change to nil if you think constants are not special...
    (let ((value (if (boundp symbol) (symbol-value symbol) '#:unique))
          (test `(lambda (,symbol)
                   (ignore-errors
                    (eq (symbol-value ',symbol) ,symbol)))))
      (values (funcall (coerce test 'function) value)))))


Seems to work (with no warnings) on ACL8.1 and SBCL.

-Jason
 




 8 Posts in Topic:
Any programmable way to ask whether a symbol has been proclaimed
usenet2.3.CalRobert@[EMAI  2008-05-11 21:20:30 
Re: Any programmable way to ask whether a symbol has been procla
Kent M Pitman <pitman@  2008-05-12 02:19:25 
Re: Any programmable way to ask whether a symbol has been procla
Chris Barts <chbarts+u  2008-05-12 17:27:41 
Re: Any programmable way to ask whether a symbol has been procla
Juho Snellman <jsnell@  2008-05-13 03:32:22 
Re: Any programmable way to ask whether a symbol has been procla
Kent M Pitman <pitman@  2008-05-12 23:38:20 
Re: Any programmable way to ask whether a symbol has been procla
jcornez@[EMAIL PROTECTED]  2008-05-16 06:57:30 
Re: Any programmable way to ask whether a symbol has been procla
rpw3@[EMAIL PROTECTED] (  2008-05-12 03:08:26 
Re: Any programmable way to ask whether a symbol has been procla
Duane Rettig <duane@[E  2008-05-12 08:17:26 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 7:23:11 CDT 2008.