in reply to Re^5: Why is const x const not a const?
in thread Why is const x const not a const?
It shows up as const AV in the opcode tree.You can prove the list is flattened once using
I see the 1 & 2, and 4 & 8 as consts, but I'm also seeing what look to me like two loops. Perhaps you can interpret it better?:
c:\test>perl -MO=Concise for (1..2) { for (4..8) { say $_++; } } ^Z t <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 4 -:1) v:{ ->3 s <2> leaveloop vK/2 ->t 7 <{> enteriter(next->p last->s redo->8) lKS/8 ->q - <0> ex-pushmark s ->3 - <1> ex-list lK ->6 3 <0> pushmark s ->4 4 <$> const[IV 1] s ->5 5 <$> const[IV 2] s ->6 6 <#> gv[*_] s ->7 - <1> null vK/1 ->s r <|> and(other->8) vK/1 ->s q <0> iter s ->r - <@> lineseq vKP ->- 8 <;> nextstate(main 2 -:2) v:{ ->9 o <2> leaveloop vK/2 ->p d <{> enteriter(next->l last->o redo->e) lKS/8 ->m - <0> ex-pushmark s ->9 - <1> ex-list lK ->c 9 <0> pushmark s ->a a <$> const[IV 4] s ->b b <$> const[IV 8] s ->c c <#> gv[*_] s ->d - <1> null vK/1 ->o n <|> and(other->e) vK/1 ->o m <0> iter s ->n - <@> lineseq vKP ->- e <;> nextstate(main 1 -:3) v:{ ->f k <1> preinc[t7] vK/1 ->l j <1> entersub[t6] sKRMS/NO(),TARG ->k f <0> pushmark s ->g - <1> ex-rv2sv sKM/1 ->h g <#> gvsv[*_] s ->h h <$> method_named[PV "say"] s ->i i <1> rv2cv /NO() ->j l <0> unstack v ->m p <0> unstack v ->q - syntax OK
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Why is const x const not a const?
by ikegami (Patriarch) on Jan 23, 2012 at 18:48 UTC | |
by BrowserUk (Patriarch) on Jan 23, 2012 at 19:31 UTC | |
by ikegami (Patriarch) on Jan 23, 2012 at 22:12 UTC |