Reserved and Forbidden Names

Twenty-seven names cannot be bound and twelve forms cannot be used. Some notations other Lisps have are simply absent here.

See it run

LISPEX
(define else 5)

else

Observed result

OUTPUT
5

else is not a reserved word. It only means something at the head of a cond, case, or guard clause, so using it as a name is accepted. (define include 1), on the other hand, is rejected with E120. include is an ordinary English word that invites use as a variable, and it sits on the forbidden list.

How to reason about it

  • Binding a reserved word is E110. Rename the variable.
  • A forbidden form in code position is E120, whether you bind it or call it. Quoted data is not code, so 'include is an ordinary symbol.
  • Notations the reader rejects never reach normalization.
  • Some notations you learned in another Lisp are simply absent here. A few have no diagnostic, so read the list below.

The twenty-seven names you cannot bind

Put any of these in a define, a let, or a parameter list and you get E110.

GroupNames
quotingquote quasiquote unquote unquote-splicing
corelambda if begin set! define
bindinglet let* letrec
branchingcond case guard and or when unless do
modulesmodule export import
values and controlvalues call-with-values call/cc dynamic-wind

The four on the last row are reserved words and procedures at once, so they can be referenced as values. The other twenty-three name forms only, and standing alone in value position they are an error.

The twelve forms you cannot use

FormWhat to use instead
define-syntax syntax-rules syntax-case let-syntax letrec-syntaxthere are no user macros. Solve it with procedures
define-values let-values let*-valuescall-with-values
define-library include include-ci include-library-declarationsmodule, and joining the files yourself

The name in code position is enough for E120. Quoted data is not code, so 'include is an ordinary symbol.

Notations the reader rejects outright

NotationResult
#; datum commentE120
#lang directiveE120
[ ] { }E100, with a message of its own

Notations that do not exist

  • The cond arrow clause => is unsupported and raises E130. The case arrow clause has no diagnostic at all, so => reads as a name and raises E300.
  • A parameter list written as a bare name with no parentheses, as in (lambda args ...), is E130. To gather arguments, write (lambda (x . rest) ...) or (define (f . xs) ...).
  • Datum labels #0= and #0# do not exist. E100.
  • There are no #! reader directives. E100. There is no notation at all for declaring something at the top of a file.
  • The radix and exactness prefixes #x #b #o #e #i do not exist. E100.
  • Pipe-quoted symbols like |a b| do not exist. | is an ordinary character, so that reads as the two names |a and b|.

A common mistake

E110 and E120 both come from names, but they mean different things. E110 means you tried to cover something that exists. E120 means you called for something that does not.

Next steps

The exact shapes live in the core and derived form references, and the meaning of each code lives in the diagnostic catalog.

Core forms · Errors and warnings