( I didn't mean to post Re^13: chopping a string into slices - is there a more elegant way to do it?. I meant to start fresh and post the following instead. )
You're basically saying that [...]
My point is simply parens don't create lists except when empty. That's it.
LanX is contradicting that, saying that parens can sometimes create a list. My rebuttal is:
perl as I understand it:
The abstraction pushed by LanX, if I understand him correctly:
He hasn't had a chance to explain how that accounts for the difference in the output of scalar(($a)=5) and scalar($a=5)
Context is a run-time issue, so that is a completely separate thing and can't influence which assignment we pick.
Sometimes context is known at run-time, but not always.
>perl -MO=Concise -e"f()" 2>&1 | find "entersub" 5 <1> entersub[t2] vKS/TARG,1 ->6 ^ | void >perl -MO=Concise -e"0+f()" 2>&1 | find "entersub" 6 <1> entersub[t2] sKS/TARG,1 ->7 ^ | scalar >perl -MO=Concise -e"print f()" 2>&1 | find "entersub" 6 <1> entersub[t2] lKS/TARG,1 ->7 ^ | list >perl -MO=Concise -e"return f()" 2>&1 | find "entersub" 6 <1> entersub[t2] KS/TARG,1 ->7 ^ | unknown at compile-time
It's used by the optimizer.
>perl -MO=Concise -e"'foo'" 3 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v ->3 - <0> ex-const v ->3 <-- The constant in void -e syntax OK context was removed from the execution path.
In reply to Re^13: chopping a string into slices - is there a more elegant way to do it?
by ikegami
in thread chopping a string into slices - is there a more elegant way to do it?
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |