From b83615f69af7f971d440b0d02db85f24afe9e39c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 3 Oct 2019 20:01:54 -0700 Subject: symbol-function: don't break existing compiled code. When a symbol-function form is used as a syntactic place, the generated code makes a run-time call to sys:get-fun-getter-setter. A recent commit changed the interface of this function, which means that such code which has been previously comipled (or somehow retained in macro-expanded form) will break. * share/txr/stdlib/place.tl (sys:get-fun-setter-getter): Change the interface so it's backward compatible with the old one: the first argument is the symbol, like before, and thanks to optional arguments, it can be called with just that argument. (defplace symbol-function): Generate code to call sys:get-fun-setter-getter accordingly. --- share/txr/stdlib/place.tl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/txr/stdlib/place.tl b/share/txr/stdlib/place.tl index 9fa15bdc..38b3aade 100644 --- a/share/txr/stdlib/place.tl +++ b/share/txr/stdlib/place.tl @@ -776,7 +776,7 @@ ^(fmakunbound ',',sym))) ,body))) -(defun sys:get-fun-getter-setter (f sym) +(defun sys:get-fun-getter-setter (sym : f) (tree-case sym ((type struct slot) (if (eq type 'meth) @@ -808,7 +808,7 @@ (defplace (symbol-function sym-expr) body (getter setter (with-gensyms (gs-sym) - ^(let ((,gs-sym (sys:get-fun-getter-setter ',sys:*pl-form* ,sym-expr))) + ^(let ((,gs-sym (sys:get-fun-getter-setter ,sym-expr ',sys:*pl-form*))) (macrolet ((,getter () ^(call (car ,',gs-sym))) (,setter (val) ^(call (cdr ,',gs-sym) ,val))) ,body)))) -- cgit v1.2.3