I said might!
Can you substantiate that the listification is always optimised away?
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
| [reply] |
No. I verified that the case of for(LIST(@_)){ ... } is optimized away into for(@_){ ... } because that is what is in the original code. I also (since you just asked) tried for(@A,@B), for(@A,@B,1) and in all cases the list op was removed. Maybe the list op shows back up when there is something non-simple to read from - functions and builtins.
| [reply] |
That's good to know, thanks.
Which version are you checking this on? And do you know if this is a recent change?
I ask because I had at least one situation where for (@array){...} definitly (seemed to?) caused a very large list to be built. At least, that's what my testing (basically watching the memory grow) showed under 5.6.1.
Update Seems I didn't keep the script, and I can't seem to reproduce the behaviour either.
I'm looking now to see if I can locate the program.
I assume that you're determining this by looking at the opcodes (as is your want:)?
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
| [reply] [d/l] |