why do
replace(({1,2,3}),2,17);
(6) Result: ({ /* 3 elements */ 1, 17, 3 })
work, while
replace(({1,2,3}),({2}),({17}));
(5) Result: ({ /* 3 elements */ 1, 2, 3 })
does nothing?
Ah, I guess multi-replace is only for strings. I tried using just two arguments with the second a mapping first, but that wasn't accepted either.
hmm, i can see how
replace(({ 1,2,3, }), ({ 2 }), ({ 17 }));
is not clear whether it is to replace 2 or ({2}), but
replace(({ 1,2,3, }), ([ 2:17 ]));
should be unmistakeable. currently it leads to an error, but i think it can be made to work.
greetings, martin.
pike-devel@lists.lysator.liu.se