[Phix] Splicing Anomaly ( resolved )
- Posted by _tom (admin) Jan 17, 2019
- 961 views
A splice "joins ends together."
You can not splice an atom because it has no ends!
This example is Phix only. (oE requires slice lengths to be the same.)
sequence s s = { 0, 5 , 5 , 0 } s[2..1] = {99} ? s -- {0,99,5,5,0} s = { 0, 5 , 5 , 0 } -- Warning! s[2..1] = 99 ? s s = { 0, 5 , 5 , 0 } s[2..2] = 99 ? s s = { 0, 5 , 5 , 0 } s[2..3] = 99 ? s -- {0,5,5,0} -- {0,99,5,0} -- {0,99,99,0}
The patterns are ok.
The "problem" is that trying to splice an atom fails quietly. The atom value just disappears without warning.
_tom