[comp.lang.scheme] How do you determine if a procedure is defined?

mac@k9.cad.mcc.com (Mac Michaels) (05/10/90)

Using only essential Scheme procedures, I have not been able to determine if
a non-essential Scheme procedure is already defined.

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: mac@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!