[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

DEFINED?



The addition of the following syntax to Scheme would allow automatic
detection of optional features of R5RS.  Currently, optional features
are frustrating because one can't use them in portable programs.
DEFINED? would allow uniform detection of feature support.

   (defined? <symbol>)					syntax

 Equivalent to #t if <symbol> is a syntactic keyword (such as IF), has
 a syntactic definition or binding (macro) or is a symbol with a
 top-level value (such as CAR).  Otherwise equivalent to #f.

My intent here is that DEFINED? clauses can be replaced at macro
expansion time with #t or #f.  It is also acceptable if DEFINED? of
lexically bound variables is #t in the scope of the binding.