[perl #113930] Lexical subs

2012-07-09 Thread Father Chrysostomos via RT
On Sun Jul 08 02:13:13 2012, thoughtstream wrote: > Father Chrysostomos pointed out: > > > I said when, not whether. :-) > > Isn't that just typical of me: confusing ontology with chronology. ;-) > > I'm afraid don't know the implementation details for Rakudo. It may be > bound as the surroundin

When do named subs bind to their variables? (Re: Questionable scope of state variables ([perl #113930] Lexical subs))

2012-07-09 Thread Father Chrysostomos via RT
I’m forwarding this to the Perl 6 language list, so see if I can find an answer there. [This conversation is about how lexical subs should be implemented in Perl 5. What Perl 6 does may help in determining how to iron out the edge cases.] On Sat Jul 07 13:23:17 2012, sprout wrote: > On Sat

Re: When do named subs bind to their variables? (Re: Questionable scope of state variables ([perl #113930] Lexical subs))

2012-07-09 Thread Father Chrysostomos via RT
from Damian, which I will enclose below, and a > Rakudo result for you. > > > [This conversation is about how lexical subs should be implemented > in > > Perl 5. What Perl 6 does may help in determining how to iron out > the > > edge cases.] > > [...] > >

Re: [perl #113930] Lexical subs

2012-07-08 Thread Damian Conway
> But by using the term ‘variable’, which is ambiguous, you are not > answering my question! :-) Sorry. I tend to think of *every* variable name as merely being an alias for some underlying storage mechanism. ;-) > Does > > my $x; > for 1..10 -> $x {} > > cause the existing name $x to ref

Re: [perl #113930] Lexical subs

2012-07-08 Thread Moritz Lenz
On 07/08/2012 09:57 PM, Father Chrysostomos via RT wrote: > my $x; > my sub f { say $x } > for 1..10 -> $x { f(); } It prints Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() (because Any is the default value in uninitialized variables). As an aside, you can run short Per

Re: When do named subs bind to their variables? (Re: Questionable scope of state variables ([perl #113930] Lexical subs))

2012-07-07 Thread Damian Conway
Father Chrysostomos asked: > What I am really trying to find out is when the subroutine is actually > cloned, Yes. It is supposed to be (or at least must *appear* to be), and currently is (or appears to be) in Rakudo. > and whether there can be multiple clones within a single call of > the encl

Re: When do named subs bind to their variables? (Re: Questionable scope of state variables ([perl #113930] Lexical subs))

2012-07-07 Thread Tom Christiansen
"Father Chrysostomos via RT" wrote on Sat, 07 Jul 2012 18:54:15 PDT: >Thank you. So the bar sub seems to be closing over the name @a (the >container/variable slot/pad entry/whatever), rather than the actual >array itself. >Since I don't have it installed, could you tell me what this does?

Re: When do named subs bind to their variables? (Re: Questionable scope of state variables ([perl #113930] Lexical subs))

2012-07-07 Thread Tom Christiansen
sation is about how lexical subs should be implemented in > Perl 5. What Perl 6 does may help in determining how to iron out the > edge cases.] [...] > This question might be more appropriate: In this example, which @a > does the bar subroutine see (in Perl 6)? > sub foo { >

[perl #77356] [BUG] Lexical subs aren't found from the where clause of a subset declaration in Rakudo

2010-08-22 Thread Carl Mäsak
o($foo) }; say 5 ~~ Foo # also found and unreported by tylercurtis++ rakudo 928836: OUTPUT«Could not find sub &foo [...] * masak submits rakudobug probably the same one that caused (causes) roles to not see lexical subs. another fun not-in-the-right-lexical-context bug right.

[perl #74186] [BUG] Lexical subs aren't found during attribute initialization in Rakudo

2010-07-16 Thread jn...@jnthn.net via RT
On Fri Apr 09 09:14:07 2010, masak wrote: > rakudo: class A { sub b { 0x10 }; has $!c = b }; A.new > rakudo 4c94d7: OUTPUT«Could not find sub &b [...] > this is biting me currently. I use subs because constants > didn't work in classes in alpha, and don't work at all in master. > jnthn: any ide

[perl #74186] [BUG] Lexical subs aren't found during attribute initialization in Rakudo

2010-04-10 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #74186] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=74186 > rakudo: class A { sub b { 0x10 }; has $!c = b }; A.new rakudo 4c94d7: OUTPUT«Could not

[perl #65498] Lexical subs are hidden by outer ones in Rakudo

2009-08-19 Thread jn...@jnthn.net via RT
On Fri May 08 05:03:12 2009, masak wrote: > rakudo: sub a { "outer" }; { my sub a { "inner" }; say a }; say a > rakudo dc680c: OUTPUT«outer␤outer␤» > fail :-( > .oO( thanks Parrot... ) Thanks to a fix in Parrot, this now works. Assigning to moritz++ for spectest. Thanks, Jonathan

[perl #67868] lexical subs can't be found in the setting

2009-07-25 Thread via RT
# New Ticket Created by Moritz Lenz # Please include the string: [perl #67868] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=67868 > If I add a lexical sub in the setting and then call it from within the same file, I get '

[perl #65498] Lexical subs are hidden by outer ones in Rakudo

2009-05-09 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #65498] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=65498 > rakudo: sub a { "outer" }; { my sub a { "inner" }; say a }; say a rakudo dc680c: OUTPU

[perl #57126] Rakudo should give a nice error about lexical subs not being implemented yet, but doesn't

2008-07-26 Thread [EMAIL PROTECTED] via RT
Hi, Thanks for reporting and helping track this one down - it was a fix in PCT in the end (in fact to the line immediately following the one you'd identified). So r29755 solves this, and probably will solve other similar issues too. Thanks! Jonathan

Re: [perl #57126] AutoReply: Rakudo should give a nice error about lexical subs not being implemented yet, but doesn't

2008-07-20 Thread Carl Mäsak
The error seems to be in the generated PIR code. From src/gen_actions.pir (lines 6306-6315): control_3001: .local pmc exception .get_results (exception, $S10) getattribute $P3250, exception, "type" # Null PMC access in type() ne $P3250, 89, control_3001_rethrow getattribute $

[perl #57126] Rakudo should give a nice error about lexical subs not being implemented yet, but doesn't

2008-07-19 Thread Carl Mäsak
om Sub 'parrot;Perl6::Gramma... [...] Ouch. That is meant to say something like "Lexical subs not yet implemented" I know it's meant to because I put the error message in to say so! [...] ah, here: src/parser/actions.pm:1984 $/.panic("Lexically scoped subs not yet implem

Re: lexical subs

2007-03-09 Thread Juerd Waalboer
Juerd Waalboer skribis 2007-03-09 21:27 (+0100): > Just a short note: please, if this is implemented, make sure that either > Perl 6 conforms to Perl 5 behaviour, or the other way around. Wanted to CC this list, but by accident replaced the To instead. Now CC'ing p5p. -- korajn salutojn, juer

Re: lexical subs

2007-03-09 Thread Juerd Waalboer
Just a short note: please, if this is implemented, make sure that either Perl 6 conforms to Perl 5 behaviour, or the other way around. -- korajn salutojn, juerd waalboer: perl hacker <[EMAIL PROTECTED]> convolution: ict solutions and consultancy <[EMAIL PROTECTED