in reply to Re^6: Why is const x const not a const?
in thread Why is const x const not a const?
Sorry, there was a set of parens missing. (Fixed.) I was about to reply to your post that for (CONST..CONST) is a counting loop rather than a loop iterating over the result of a range operator. There is no range operator, so the range operator cannot be flattened. Try
perl -e"<>; exit; @a = 1..100000;" perl -e"<>; exit; for ((), 1..100000) {}"
Results:
perl -e"<>; exit; for ((),1.. 1000) {} 1,252K perl -e"<>; exit; for ((),1.. 10000) {} 1,784K perl -e"<>; exit; for ((),1.. 100000) {} 6,028K perl -e"<>; exit; for ((),1..1000000) {} 45,212K
Update: Added results.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^8: Why is const x const not a const?
by BrowserUk (Patriarch) on Jan 23, 2012 at 19:31 UTC | |
by ikegami (Patriarch) on Jan 23, 2012 at 22:12 UTC |