symbol-function does not handle encapsulation
Bug #799533 reported by
David Vázquez
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Triaged
|
Medium
|
Unassigned |
Bug Description
Consider the following code:
(defun foo (x) x)
(trace foo)
(eq (symbol-function 'foo) (fdefinition 'foo)) => NIL
Nevertheless, according to the CLHS, for symbols is verified
(symbol-function symbol) == (fdefinition symbol)
Should not symbol-function resolve encapsulation just like fdefinition does?
To post a comment you must log in.
Huh, I could have sworn we had a bug about this already.
Our current encapsulation scheme is a bit of a mess. Whoever tackles this, consider at least the following issues:
1. Generally speaking we want functions to stay encapsulated when they are redefined. At least for TRACE.
2. If behaviour of either SYMBOL-FUNCTION or FDEFINITION changes, check that EVAL and CLOS still do the right thing. (Evaluator should use the encapsulation. CLOS should... not sure offhand.)
Sorting out the whole mess into an exported ADVICE or FRWAP facility would be very nice. The current design is also pretty terrible in terms of performance.