This makes things much slower for questionable benefit. A better
version might use a hash table. A better interpreter would use
some form of partial evaluation to optimize the EQ? chain.
This reverts commit 4acea69841.
After taking a look at the R7RS syntax and how Chicken parses
directives, I realized that it's easier to have "#!", "#\\", etc.
parse identifiers instead of baking in trie actions. This is slightly
slower but completely removes the trie concept from the readtable,
which simplifies the implementation and removes many corner cases
involving combining readtables with different action types.
sequences.
Previously, if "#true" and "#t" were in the readtable as sequences,
the string "#true" would call "#true"'s EXEC function after reading
"e", but it would call "#t"'s EXEC function after reading a
character after "t" (which could be EOF).
The new behavior normalizes everything so that the ACTIONs read the
character after the sequence.
Previous version did (ACTION 'UPDATE (CDR REST) ACTION) when a new
action had to be made. This caused default actions to propagate
through the trie.
While this isn't bad (it causes #TRU to be equal to #TRUE when that
was the last prefix in the tree), it can cause unexpected errors at
runtime, and no program should ever depend on its behavior.
The current solution is to make a new PASS readtable with a default
error action.