diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-04-05 21:09:35 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-04-05 21:09:35 -0700 |
commit | d69c6738731c24a8336f2734cee48547320d589c (patch) | |
tree | 058afba3cd82af7aca65a6319b1138d8e3b6df6c /txr.1 | |
parent | 444853031ea9e9a2a79c259c2696cc0b6dda18ff (diff) | |
download | txr-d69c6738731c24a8336f2734cee48547320d589c.tar.gz txr-d69c6738731c24a8336f2734cee48547320d589c.tar.bz2 txr-d69c6738731c24a8336f2734cee48547320d589c.zip |
Indexing in variable subst applies to any sequence.
The @{a [3]} syntax in quasiliterals and @(output) now
indexes into the original object a if it is any sequence
kind, not specifically a list. Otherwise it indexes into
its string representation.
* eval.c (format_field): Combine the elements of the
object with the separator if it is any sequence type other
than a string. Subject to compat option.
(subst_vars): Avoid converting any kind of sequence to
string, rather than just lists. After any field formatting
is applied, if the object is any sequence (not just alist),
combine the elements with a space. All subect to compat
option.
* match.c (tx_subst_vars): Same treatment as subst_vars.
* txr.1: Compatibility notes added.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -53367,6 +53367,23 @@ of these version values, the described behaviors are provided if is given an argument which is equal or lower. For instance .code "-C 103" selects the behaviors described below for version 105, but not those for 102. +.IP 174 +A value of 174 or lower restores a previous behavior of variable substitution +in the +.code output +directive and in quasiliterals in both the \*(TX pattern language and \*(TL. +The behavior in question is the evaluation of the element indexing or +range selection modifier, exemplified by +.codn "@{a [2]}" . +The previous behavior was that if the variable is of any type other +than list, it is converted to a string (unless it already is one). +The indexing then applies to the string. If it is a list then the +indexing or range selection applies to the original list value, +prior to conversion to text. The current behavior is that indexing +and range selection is applied to the original value if that value +is any sequence type which satisfies the +.code seqp +function, otherwise to the string representation. .IP 172 A value of 172 or lower restores a behavior of the \*(TX pattern matching language when matching a variable followed by a directive, such as |