ShenDoc 30


 

 

The Syntax of Symbols

In Shen an atom is either a symbol, boolean, string or number. All atoms, thus including symbols, are self-evaluating. The empty list is not counted as an atom but is also self-evaluating. Hence there is no quote in Kλ or Shen. Mapping into CL which does use quote is trivial. The function symbol? is the recognisor for symbols; their BNF is as follows.

<symbol> := <alpha> <symbolchars> | <alpha>
<symbolchars> := <alpha> <symbolchars> | <digit> <symbolchars> | <alpha> | <digit>
<alpha> := a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s 
           | t | u | v | w | x | y | z
<alpha> := A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S 
           | T | U | V | W | X | Y | Z
<alpha> := = | - | * | / | + | _ | ? | $ | ! | @ | ~ | . | > | < | & | % | ' | # | ` 
           | ; | : | ?? | ??
<digit> := 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

A symbol is a variable if it begins in an uppercase letter.

Acknowledgements

History
Basic Types in Shen and Kλ
The Primitive Functions of Kλ
The Syntax of Kλ
Notes on the Implementation of Kλ
Boolean Operators
The Syntax of Symbols
The Semantics of Symbols in Shen and Kλ
Packages
Prolog
Shen-YACC
Strings
Strings and Pattern Matching
Lists
Streams
Character Streams and Byte Streams
Bytes and Unicode
Reader Macros
Vectors
Standard Vectors and Pattern Matching
Non-standard Vectors and Tuples
Equality
I/O
Generic Functions
Eval
Type Declarations
External Global Variables
Property Lists and Hashing
Error Handling
Numbers
Floats and Integers
The Timer
Comments
Special Forms

Built by Shen Technology (c) Mark Tarver, September 2021