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

DEFINED?



   Date: Wed, 20 May 92 12:42:30 -0400
   From: "Aubrey Jaffer" <jaffer@martigny.ai.mit.edu>

   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.

The top-level restriction is problematic in that many inplementations
do not have a concept of top-level.

   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.

I believe that much more than defined is needed to use optional
features.  One also needs to know the arity of a form an dpossibly
clues as to its semantics.  

I might support a more limited proposal that just allowed for testing
of the existance of optional features in the report.
--------------------
Morry Katz
katz@cs.stanford.edu
--------------------