[Phix] Splicing Anomaly ( resolved )

new topic     » topic index » view thread      » older message » newer message

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

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu