Perl: the Markov chain saw | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
In my frenzy to chase down novel (to me) ideas, I neglected to comment on L~R's main point, which I'll immodestly restate as:
What if Perl had a language construct for "Do this only once"?(We can argue about whether this should be "once" or "N times".) The core idea is once the test fails, it's removed from the optree. What would we use for syntax? or more often Would it be useful? It seems it's only merit is in speeding up tight loops, where even checking a boolean is noticeable. Would it cause bugs? Yes, definitely. There would be a cargo cult of "Use once to optimize conditionals", when very few situations actually benefit from it. Is it more convenient than anything existing? Yes, indeed. I have yet to see anything that approaches the efficiency of once. I'll be interested in seeing if this idea catches fire, implemented, and how many bugs it generates. -QM In reply to Re: Doing "it" only once
by QM
|
|