summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-07-29 20:33:35 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-07-29 20:33:35 -0700
commitddd576f8320ba50df0ca77aaad1829e5cc18d708 (patch)
treea2c0a338e43c59fa7f7a7c2acb640794ea28306f
parentd7c36a8a2497d2d01668db58d2b339157ae35db3 (diff)
downloadtxr-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.tl10
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