Just another Perl shrine | |
PerlMonks |
Re: Re: Re: Using $_ as a temp var, especially in functionsby BrowserUk (Patriarch) |
on Oct 24, 2002 at 00:08 UTC ( [id://207582]=note: print w/replies, xml ) | Need Help?? |
Interesting point. I hadn't considered Perl 6, I'm trying hard not to get excited about until it's a little closer to fruition. When you say "the for will probably be translated to a given", do you mean by an automated process? Is there an intention to provide a p5top5.pl or binary? I thought that the route was to have a p5 'mode' rather than conversion? Given all the different ways the scalar value in the for loop could be provided
Unless this p5top6 processor is going to act at the bytecode level, its going to have to be a fairly sophisticated piece of code to catch all the possible variations where the topicaliser of the for returns a scalar and not a list? Would it be that much more work to have it check to see if the first line inside a bareblock was local $_ = expression; which by definition must be assigning a scalar? Thinking about this further, I'm not sure I understand though. As given is a case-type construct, converting a one-time for to a given would result in some strange code
Becoming
I'm not quite clear how you would express the always? Though I assume given will have an equivalent of C's default: clause, so I guess it could become
But I'm not sure that's much better. Cor! Like yer ring! ... HALO dammit! ... 'Ave it yer way! Hal-lo, Mister la-de-da. ... Like yer ring!
In Section
Meditations
|
|