summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-10-03 20:01:54 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-10-03 20:01:54 -0700
commitb83615f69af7f971d440b0d02db85f24afe9e39c (patch)
tree35567d3a232f6fda66ff699991554088fb0590b1
parent8660816e37a7a169ec41d50d9067b3889c9a6186 (diff)
downloadtxr-b83615f69af7f971d440b0d02db85f24afe9e39c.tar.gz
txr-b83615f69af7f971d440b0d02db85f24afe9e39c.tar.bz2
txr-b83615f69af7f971d440b0d02db85f24afe9e39c.zip
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.
-rw-r--r--share/txr/stdlib/place.tl4
1 files 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))))