From b2f9bf87fae7f8e038dbc34b20ca9aea939fee8a Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 9 Apr 2018 06:59:32 -0700 Subject: awk/struct: fix breakage under interpreted mode. References to rslot must be usr:rslot because there is a sys:rslot. Some difference in loading order causes this not to be a problem when runing compiled "make tests", but if the .tlo files are removed, the awk test case fails. * share/txr/stdlib/awk.tl (sys:awk-mac-let): Replace rslot with usr:rslot. * share/txr/stdlib/struct.tl (rslot): Replace rslot symbol token with usr:rslot in definitions of rslot macro and rslot place macro. --- share/txr/stdlib/awk.tl | 12 ++++++------ share/txr/stdlib/struct.tl | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'share') diff --git a/share/txr/stdlib/awk.tl b/share/txr/stdlib/awk.tl index 949991ea..cb6e73c9 100644 --- a/share/txr/stdlib/awk.tl +++ b/share/txr/stdlib/awk.tl @@ -351,10 +351,10 @@ subform kind suspicious-vars))) (defmacro sys:awk-mac-let (awc aws-sym . body) - ^(symacrolet ((rec (rslot ,aws-sym 'rec 'rec-to-f)) - (orec (rslot ,aws-sym 'orig-rec 'rec-to-f)) - (f (rslot ,aws-sym 'fields 'f-to-rec)) - (nf (rslot ,aws-sym 'nf 'nf-to-f)) + ^(symacrolet ((rec (usr:rslot ,aws-sym 'rec 'rec-to-f)) + (orec (usr:rslot ,aws-sym 'orig-rec 'rec-to-f)) + (f (usr:rslot ,aws-sym 'fields 'f-to-rec)) + (nf (usr:rslot ,aws-sym 'nf 'nf-to-f)) (nr (qref ,aws-sym rec-num)) (fnr (qref ,aws-sym file-rec-num)) (arg (qref ,aws-sym file-num)) @@ -449,10 +449,10 @@ (-rng+ (:form form from-expr to-expr) ^(sys:rng-if ,form ,from-expr ,to-expr)) (--rng+ (:form form from-expr to-expr) ^(sys:rng-if ,form ,from-expr ,to-expr)) (ff (. opip-args) - ^(symacrolet ((f (rslot ,',aws-sym 'fields 'f-to-rec))) + ^(symacrolet ((f (usr:rslot ,',aws-sym 'fields 'f-to-rec))) (set f [(opip ,*opip-args) f]))) (mf (. opip-args) - ^(symacrolet ((f (rslot ,',aws-sym 'fields 'f-to-rec))) + ^(symacrolet ((f (usr:rslot ,',aws-sym 'fields 'f-to-rec))) (set f (mapcar (opip ,*opip-args) f)))) (fconv (. conv-args) ^(set f (sys:conv (,*conv-args) f))) diff --git a/share/txr/stdlib/struct.tl b/share/txr/stdlib/struct.tl index 91d04f81..86b86197 100644 --- a/share/txr/stdlib/struct.tl +++ b/share/txr/stdlib/struct.tl @@ -316,10 +316,10 @@ (slotset struct sym val) (call (umethod meth-sym) struct))) -(defmacro rslot (struct sym meth-sym) +(defmacro usr:rslot (struct sym meth-sym) ^(slot ,struct ,sym)) -(define-place-macro rslot (struct sym meth-sym) +(define-place-macro usr:rslot (struct sym meth-sym) ^(sys:rslot ,struct ,sym ,meth-sym)) (defplace (sys:rslot struct sym meth-sym) body -- cgit v1.2.3