4.2.1 Atoms

There are four syntactic forms for atoms. The reserved words are not atoms and if you accidentally use a reserved word as an atom the parser will produce a syntax error.

  1. A lower case letter followed by any sequence consisting of "_" and alphanumeric characters.
    For example:
    percy_smith_2
    semester_1
    
  2. Any combination of the following set of graphic characters.
    |-/+*<=>#@$\^&~:.?
    

    For example:

    @<=
    
  3. Any sequence of characters enclosed by "'" (single quote). Single quote can be included in the sequence by writing the quote twice. "\" indicates an escape sequence, where the escape characters are case insensitive. The possible escape characters are:
    newline Meaning: Continuation
    ^ Meaning: Same as d.
    ^character Meaning: Control character.
    dd Meaning: A two digit octal number.
    a Meaning: Alarm (ASCII = 7).
    b Meaning: Backspace (ASCII = 8).
    c Meaning: Continuation.
    d Meaning: Delete (ASCII = 127).
    e Meaning: Escape (ASCII = 27).
    f Meaning: Formfeed (ASCII = 12).
    n Meaning: Newline (ASCII = 10).
    odd Meaning: A two digits octal number.
    r Meaning: Return (ASCII = 13)
    s Meaning: Space (ASCII = 32).
    t Meaning: Horizontal tab (ASCII = 9).
    v Meaning: Vertical tab (ASCII = 11).
    xdd Meaning: A two digit hexadecimal number.

    Here are a few examples of quoted atoms.

    'hi!'
    'they''re'
    '\n'
    

On This Site