Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

[perl #53902] my @var1, @var2 not working
# New Ticket Created by  Moritz Lenz
# Please include the string:  [perl #53902]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=53902 >


Rakudo as of r27393 can't handle multiple declarations in a single "my":

> my (@a, @b); say @a
Scope  not found for PAST::Var '@a'
> my @a, @b; say @a
Scope  not found for PAST::Var '@b'

Implementing that shouldn't be too hard, and would fix quite some of the
spec test failures.

Cheers,
Moritz

--
Moritz Lenz
http://moritz.faui2k3.org/ |  http://perl-6.de/



Report this thread to moderator Post Follow-up to this message
Old Post
Moritz Lenz (via RT)
05-09-08 01:35 PM


Re: [perl #53902] my @var1, @var2 not working
On Thu, May 08, 2008 at 11:28:36AM -0700, Moritz Lenz wrote:
> Rakudo as of r27393 can't handle multiple declarations in a single "my":
> 
> Scope  not found for PAST::Var '@a'

We'll work on this one.
 
> Scope  not found for PAST::Var '@b'

Rakudo has this one correct -- according to S03, scoping
multiple variables with 'my' requires the parens:

:    my $a;                  # okay
:    my ($b, $c);            # okay
:    my ($b = 1, $c = 2);    # okay - "my" intializers assign at runtime
:    my $b, $c;              # wrong: "Use of undeclared variable: $c"

Pm


Report this thread to moderator Post Follow-up to this message
Old Post
Patrick R. Michaud
05-10-08 12:47 AM


Re: [perl #53902] my @var1, @var2 not working
On Fri, May 09, 2008 at 06:47:12PM -0500, Patrick R. Michaud wrote:
> On Thu, May 08, 2008 at 11:28:36AM -0700, Moritz Lenz wrote: 
>
> We'll work on this one.
> 
>
> Rakudo has this one correct -- according to S03, scoping
> multiple variables with 'my' requires the parens:
>
> :    my $a;                  # okay
> :    my ($b, $c);            # okay
> :    my ($b = 1, $c = 2);    # okay - "my" intializers assign at runtime
> :    my $b, $c;              # wrong: "Use of undeclared variable: $c"

But is that really the error message you want to be giving for that syntax
error? The double spaces suggest that something internal isn't even
interpolating as expected, due to a the string form of a name being missing.

Nicholas Clark


Report this thread to moderator Post Follow-up to this message
Old Post
Nicholas Clark
05-10-08 10:21 AM


Re: [perl #53902] my @var1, @var2 not working
On Sat, May 10, 2008 at 09:43:38AM +0100, Nicholas Clark wrote:
> On Fri, May 09, 2008 at 06:47:12PM -0500, Patrick R. Michaud wrote: 
>
> But is that really the error message you want to be giving for that syntax
> error? The double spaces suggest that something internal isn't even
> interpolating as expected, due to a the string form of a name being missing.[/colo
r]

You're correct, the error message itself needs updating.  At the moment
the error is being caught during code generation (in PCT), whereas
ideally we'd like to catch it during the parse (in the action
method).  At that point we can give a better error message.

Pm


Report this thread to moderator Post Follow-up to this message
Old Post
Patrick R. Michaud
05-11-08 12:49 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Perl 6 Compiler archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:43 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.