[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bad to hang properties off keywords to install their semantics



I don't think it's a good idea to implement keyword usage (semantics) by
having each function that uses that keyword to hang a property off that
keyword. The reason is you can have hundreds of different uses for a single
keyword (for example :REVERSE to do some operation backwards from default,
:IP to do something in place, :FAST to make it run fast, etc.), so then
it takes a long time each time you use that keyword for the function to
scan down the keyword's property list looking for the one item that
tells this particular function what to do while ignoring all the other
properties that are used by other functions. Better to hang the keyword
as a property-tag off the property list of the function, that way the
search is for the various keywords used by one function rather than the
various functions that use one keyword and thus the search length is
under the control of whoever wrote that function rather than being the
total search length by however many packages may be loaded.

As an alternative to using the property list of either the keyword
or the funcion, you could use the value cell of that keyword or function
pointing to a hash table, although in the case of keywod.value-->hashtable
you have to a general concensus.

One other problem with hanging anything at all of a shared thing such as
a keyword property-list cell, is that if you have interrupts you have
to carefully interlock all updates. If you hang things off the function
name instead, you only have to interlock against other processes in
the same package, which may be a lot more managable.

In my opinion, it's totally painful to have either value or function
cells hanging off a keyword, except in the case where there is some
global agreement about that that cell will hold (such as a hashtable),
and it's workable but rather inefficient to put properties on the keyword.
-------