[perl #58070] [RFC] Disallow .local declarations in long-style call statement

Will Coleda via RT parrotbug-followup at parrotcode.org
Mon Nov 2 02:20:24 UTC 2009


On Mon Aug 18 07:48:54 2008, kjs wrote:
> the current implementation for PIR allows one to declare .locals in a
> .begin_call/.end_call sequence, after the .call directive, like so:
> 
> .begin_call
> .arg 1
> .arg 2
> .call $P0
> .local int a, b, c
> .result a
> .result b
> .result c
> .end_call
> 
> (this is short for (a, b, c) = $P0(1, 2) )
> 
> IMHO, the whole sequence of directives from .begin_call to .end_call should
> be considered 1 statement; having .local declarations intermixed with
> .result directives is a bit strange, because the .local directive itself is
> not part of the sequence of directives to make the call.
> 
> Furthermore, the locals stay in scope after the .end_call directive.
> 
> I propose to disallow this language 'feature', and force the programmer to
> write the above example as follows:
> 
> .local int a, b, c
> .begin_call
> .arg 1
> .arg 2
> .call $P0
> .result a
> .result b
> .result c
> .end_call
> 
> comments welcome.
> 
> kjs

Now being tracked at https://trac.parrot.org/parrot/ticket/1174
-- 
Will "Coke" Coleda


More information about the parrot-dev mailing list