previous up next     contents index
Next: Evaluation Handler Up: Additional Facilities Previous: Constant Names

Keywords

 

  Keyword names cannot be redefined or used as local variable names. Primitive syntax names (the ones listed in Figure 3.1) are reserved keywords, as are cond, and, or, case, let*, do, and quasiquote. For every built-in procedure x, there is a corresponding keyword #%x that accesses the same value. Built-in syntactic forms that are not themselves keywords also have corresponding #% keywords.

There are no other global keywords. Local keywords -- such as else within a cond expression or public within a class* expression -- are not globally enforced. This means, for example, that the name else may be bound to a value, but else as the first part of a cond clause will not reference such a binding.

A new keyword is declared with   (keyword-name s), where s is a symbol. Once a symbol s has been designated as a keyword, it cannot be bound locally or globally. Keywords declared this way are local to the namespace.

MzScheme can run a mode without keywords (see section 2.15), but some built-in syntax and procedures will break in this mode if certain global variables are defined.



PLT