summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-03-29 20:36:07 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-03-29 20:36:07 -0700
commite81e489cec32d4b68b3042fa61ff2580d0fb5ec2 (patch)
tree3312391df443f54e5911791af9cd4597a64fa2b5
parent223f563cef92bead11abbdd3d44ca4c1d208c20d (diff)
downloadtxr-e81e489cec32d4b68b3042fa61ff2580d0fb5ec2.tar.gz
txr-e81e489cec32d4b68b3042fa61ff2580d0fb5ec2.tar.bz2
txr-e81e489cec32d4b68b3042fa61ff2580d0fb5ec2.zip
Important improvement in opip: support slot access.
* eval.c (me_opip): Just like dwim forms are left untransformed, we also leave untransformed (uref ...) and (qref ...) forms. Otherwise they get wrapped in the (do ...) syntax and don't work right. This treatment is so broken/useless that no compatibility switch is needed here. * txr.1: Documentation for opip/oand updated.
-rw-r--r--eval.c2
-rw-r--r--txr.111
2 files changed, 11 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index b6cfbb87..fc00a630 100644
--- a/eval.c
+++ b/eval.c
@@ -3665,7 +3665,7 @@ static val me_opip(val form, val menv)
uses_or2;
val sym = car(clause);
- if (sym == dwim_s) {
+ if (sym == dwim_s || sym == uref_s || sym == qref_s) {
list_collect(ptail, clause);
} else {
val opdo = if3(or2(macro_form_p(clause, menv),
diff --git a/txr.1 b/txr.1
index 877ea80e..58c62977 100644
--- a/txr.1
+++ b/txr.1
@@ -38542,6 +38542,10 @@ notation denotes the following transformation applied to each argument:
(macro ...) -> (do macro ...)
(dwim ...) -> (dwim ...)
[...] -> [...]
+ (qref ...) -> (qref ...)
+ (uref ...) -> (uref ...)
+ .slot -> .slot
+ .(method ...) -> .(method ...)
atom -> atom
.cble
@@ -38553,7 +38557,12 @@ notation. Compound forms denoting function calls are translated to the
notation. Compound forms which are
.code dwim
invocations, either explicit or via the DWIM brackets notation, are
-preserved, as are any forms which are atoms.
+used without transformation. Used without transformation also are forms
+denoting struct slot access, either explicitly using
+.code uref
+or
+.code qref
+or the respective dot notations, as well as any atom forms.
Note: the
.code opip