[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
constant folding/smashing
re: What about constant hash-tables? No variety of QUOTE can build
a constant hash table because there is no notation for them.
(I don't count #.(make-hash-table...) because it's so gross.)
Lucid's "Re-Targetable" compiler is table driven; the tables are ordinary
CL hashtables. In recent images, they are stored in read-only memory, since
all the key entries are symbols, and since they change very rarely (such
as when someone is debugging the compiler). A "lazy migration" scheme
ensures that they become writeable upon demand.
There is a proposal before X3J13 now (presented by Dave Touretzky) to
give a printable representation to hashtables. If a sufficiently powerful
version of it is adopted, then it should be possible to use QUOTE to
reference a constant hashtable.
I don't think the techniques that Lucid uses to build read-only tables
are exported to the end-user; but it certainly is possible to reference
"constant" hashtables using the "gross" #. notation, and have such code
be compiled and loaded correctly.
-- JonL --