summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--stdlib/infix.tl1
-rw-r--r--txr.18
2 files changed, 8 insertions, 1 deletions
diff --git a/stdlib/infix.tl b/stdlib/infix.tl
index 54d24ca9..7eee5ad7 100644
--- a/stdlib/infix.tl
+++ b/stdlib/infix.tl
@@ -305,6 +305,7 @@
(boundp tok)))
tok)
(@(require (@x @y . @rest)
+ (consp rest)
(and (not (funp env x)) (funp env y)))
(let ((rexp (infix-expand-hook rest env nil)))
(if (eq rexp rest)
diff --git a/txr.1 b/txr.1
index 6c44b77d..d81a0b3b 100644
--- a/txr.1
+++ b/txr.1
@@ -54420,7 +54420,7 @@ A form not falling into any of the above rules is recognized as "phony infix"
if it conforms to one of two situations:
.RS
.IP 1.
-It consists of at least two elements, where the first element is not
+It consists of at least three elements, where the first element is not
a function, and the second element is a function. Both the lexical and
global function namespaces are considered.
When a form is thus recognized, it is transformed by exchanging the first and
@@ -54480,6 +54480,12 @@ same manner as for the expression
which is transformed to
.codn "(list 1 (+ 2 2))" .
+The expression
+.code "(1 list)"
+is not recognized as phony infix and not thus not transformed into
+.code "(list 1)"
+because it doesn't have three or more elements.
+
Only compound expressions are recognized as infix. A sequence
of atoms like
.code "a * b"