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
commit8c54c88d215e00b1af08f126b3f44b1fc9332942 (patch)
tree35567d3a232f6fda66ff699991554088fb0590b1
parentc2303048fcf3b831a5d412da20a145206b5a57c0 (diff)
downloadtxr-8c54c88d215e00b1af08f126b3f44b1fc9332942.tar.gz
txr-8c54c88d215e00b1af08f126b3f44b1fc9332942.tar.bz2
txr-8c54c88d215e00b1af08f126b3f44b1fc9332942.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))))