PROCEDURE? fails with an undefined symbol error when given a non-existent
symbol name. If you quote the argument to PROCEDURE? it always returns #F.
To attempt to get around this with SYMBOL? is also futile. SYMBOL? also
gets an undefined symbol error when given a non-existent symbol name and
always returns #T when given a quoted name.
Why is it needed? I am trying to write a file that can be loaded into any
Scheme that will add some of the missing procedure definitions. This will
allow me to easily port code to a number of different Scheme
implementations. I do not want to replace the implementation's
non-essential function if it already exists.
Some ways that this problem could be addressed are:
Add a special form (say DEFINED?) that returns #T if it's unquoted
argument exists.
Add a procedure to return the Scheme system name and version number.
--
USPS: Mac Michaels, 3500 West Balcones Center Dr., Austin,TX 78759
ARPA: m...@mcc.com TELE: (512) 338-3509 FAX: (512) 338-3600
UUCP: {uunet,harvard,gatech,pyramid}!cs.utexas.edu!milano!cadillac!mac
:-)))))))) She had so many chins, she looked like a piece of Lisp code!
Elk has a predicate "bound?" which, when applied to a symbol, returns
#t iff the variable named by the symbol is bound in the current
environment.
I think T has a "bound?" predicate, too; at least a "grep" on the
sources says so.
I'm sure C-Scheme has a similar function as well (it must, since it
has virtually everything :-)
XScheme has a "bound?" predicate similar to the one in Elk.
Regards,
--
Oliver Laumann n...@TUB.BITNET n...@tub.cs.tu-berlin.de n...@tub.UUCP