summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-09 06:59:32 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-09 06:59:32 -0700
commitb2f9bf87fae7f8e038dbc34b20ca9aea939fee8a (patch)
tree7add85d50398531711912c65baeb64152d41bd0b
parent88ef8586294631a628b06849cc333d75f3d78b78 (diff)
downloadtxr-b2f9bf87fae7f8e038dbc34b20ca9aea939fee8a.tar.gz
txr-b2f9bf87fae7f8e038dbc34b20ca9aea939fee8a.tar.bz2
txr-b2f9bf87fae7f8e038dbc34b20ca9aea939fee8a.zip
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.
-rw-r--r--share/txr/stdlib/awk.tl12
-rw-r--r--share/txr/stdlib/struct.tl4
2 files changed, 8 insertions, 8 deletions
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