From ddd576f8320ba50df0ca77aaad1829e5cc18d708 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 29 Jul 2023 20:33:35 -0700 Subject: 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. --- stdlib/place.tl | 10 +++++----- 1 file 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 -- cgit v1.2.3