Unary + appends zero to lists.
Example:
acid: +{}
{0x00000000}
acid: +{1}
{0x00000001, 0x00000000}
acid: defn x() { return {1} ; }
acid: +x()
{0x00000001, 0x00000000}
Cause:
The parser converts '+x' to 'x+0'. Such is reasonable for
numeric arguments and has no effect on strings. Unfortunately
for lists, it results in a zero being appended.
This patch:
The parser converts '+x' to 'x+ZN' and oadd() handles the ZN
rhs when the expression is evaluated.
Patched:
acid: +{}
acid: +{1}
{0x00000001}
acid: defn x() { return {1} ; }
acid: +x()
{0x00000001}
|