[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Translator
Date: Fri, 14 Sep 90 20:20 EDT
From: RWK@fuji.ila.com (Robert W. Kerns)
APPLY does not use hash tables. However, for maximum speed and
minimum paging, you should pass actual functions, and not
symbols, to apply. I.e
(setf (gethash name *name->function-table*) #'rewrite-function)
not
(setf (gethash name *name->function-table*) 'rewrite-function)
However, you should note that this mechanism can be a pain during
development. If you redefine REWRITE-FUNCTION after storing the
function in the table the first way, you will continue to call the old
definition when you extract it, while the second form will cause the
current function binding of the symbol always to be used.
I campaigned (and won) for automatic coercion of symbols to functions by
APPLY, FUNCALL, etc. in X3J13 for precisely this reason. I've seen
users burned many times when they store a function in a data structure,
load a patch file that fixes a bug in the function, yet the bug still
appears.
I also applaud Genera 8.0's enhancement to the printed representation of
functions: a function object that isn't the current binding of its name
symbol has "(Superceded)" in the printed rep.
barmar
- Follow-Ups:
- Translator
- From: Reti@WESER.sreti.symbolics.com (Kalman Reti)
- References:
- Translator
- From: RWK@fuji.ila.com (Robert W. Kerns)