For Gauche 0.9.10

Next: , Previous: , Up: Concepts   [Contents][Index]

2.4 Case-sensitivity

Historically, most Lisp-family languages are case-insensitive for symbols. Scheme departed from this tradition since R6RS, and the symbols are read in case-sensitive way. (Note that symbols have been case-sensitive internally even in R5RS Scheme; case-insensitivity is about readers.)

Gauche reads and writes symbols in case-sensitive manner by default, too. However, to support legacy code, you can set the reader to case-insensitive mode, in the following ways:

Use #!fold-case reader directive

When Gauche sees a token #!fold-case during reading a program, the reader switches to case-insensitive mode. A token #!no-fold-case has an opposite effect—to make the reader case-sensitive. These tokens affect the port from which they are read, and are in effect until EOF or another instance of these tokens are read. See Lexical structure for more details on #! syntax. This is the way defined in R6RS and R7RS.

Use -fcase-fold command-line argument

Alternatively, you can give a command-line argument -fcase-fold to the gosh command (see Invoking Gosh). In this mode, the reader folds uppercase characters in symbols to lowercase ones. If a symbol name contains uppercase characters, it is written out using |-escape (see Symbols).

Next: , Previous: , Up: Concepts   [Contents][Index]