diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-07-29 20:33:35 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-07-29 20:33:35 -0700 |
commit | ddd576f8320ba50df0ca77aaad1829e5cc18d708 (patch) | |
tree | a2c0a338e43c59fa7f7a7c2acb640794ea28306f | |
parent | d7c36a8a2497d2d01668db58d2b339157ae35db3 (diff) | |
download | txr-ddd576f8320ba50df0ca77aaad1829e5cc18d708.tar.gz txr-ddd576f8320ba50df0ca77aaad1829e5cc18d708.tar.bz2 txr-ddd576f8320ba50df0ca77aaad1829e5cc18d708.zip |
places: regression in symbol-function place.
* stdlib/place.tl (sys:get-fun-getter-setter): The check added
recently for a non-bindable sym at the top is completely
bogus, and makes it impossible to use trace for methods.
The function handles various kinds of function names that
are not symbols. The check must be done in the fallback
case, where plain symbols are handled.
-rw-r--r-- | stdlib/place.tl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/stdlib/place.tl b/stdlib/place.tl index bcf54ccc..5d601834 100644 --- a/stdlib/place.tl +++ b/stdlib/place.tl @@ -800,8 +800,6 @@ ,body))) (defun sys:get-fun-getter-setter (sym : f) - (unless (bindable sym) - (compile-error f "~s isn't a bindable symbol" sym)) (tree-case sym ((type struct slot) (if (eq type 'meth) @@ -824,9 +822,11 @@ (compile-error f "cannot assign to lambda") (compile-error f "invalid function syntax ~s" sym))) (else - (let ((cell (inhash sys:top-fb else nil))) - (cons (op cdr) - (op sys:rplacd cell)))))) + (if (bindable else) + (let ((cell (inhash sys:top-fb sym nil))) + (cons (op cdr) + (op sys:rplacd cell))) + (compile-error f "~s isn't a bindable symbol" else))))) (defplace (symbol-function sym-expr) body (getter setter |