You've showed that Deparse considers for (;;) {} and while (1) {} equivalent (which means there's a strong chance that they are very similar). This is consistent with while (1) {} getting optimised to for (;;) {}, so it doesn't support your contradiction.
You've showed that Deparse considers while (1) {} to be more readable than for (;;) {} on average. This doesn't support your contradiction.
So you didn't show that while (1) {} doesn't get optimised to for (;;) {}. Easy to prove that it does, though. Note the lack of any condition in the following:
>perl -MO=Concise,-exec -e"while (1) {}" 1 <0> enter 2 <;> nextstate(main 3 -e:1) v:{ 3 <{> enterloop(next->5 last->6 redo->4) v 4 <0> stub v 5 <0> unstack v -e syntax OK
For comparison,
>perl -MO=Concise,-exec -e"for (;;) {}" 1 <0> enter 2 <;> nextstate(main 3 -e:1) v:{ 3 <{> enterloop(next->5 last->6 redo->4) v 4 <0> stub v 5 <0> unstack v -e syntax OK
In reply to Re^7: Memory leak!
by ikegami
in thread Memory leak!
by joeymac
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |