Skip Menu |
Report information
Id: 129263
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: smls75 [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [CONC] Outer dynamic variable not found in nested `start` block
Download (untitled) / with headers
text/plain 775b
➜ my $*a = 42; await start { say $*a } 42 ➜ my $*a = 42; await start { await start { say $*a } } Dynamic variable $*foo not found IRC discussion (rearranged for clarity): <smls> Are threads supposed to see dynamic variables declared in the mainline prior to starting the thread? <jnthn> A start block will go the extra mile to make that happen <jnthn> It just takes the CALLER:: of whatever calls Promise.start iirc <jnthn> But if you work directly with threads then every one has its own fresh dynamic scope ... <smls> Should that still work, when it's 2 levels deep into `start`? <jnthn> Umm...I guess it'd be nice if it worked. <jnthn> Can RT it; I don't see why we can't fix that.
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
Subject: Re: [perl #129263] [CONC] Outer dynamic variable not found in nested `start` block
To: "Sam S. (via RT)" <perl6-bugs-followup [...] perl.org>
Date: Tue, 13 Sep 2016 15:13:12 +0200
Download (untitled) / with headers
text/plain 1.3k
Feels to me some kind of loop would need to be made around line 33 in src/core/stubs.pm, basically looping until we either find the dynamic variable, or look for a $*PROMISE in the context and if so, try to find it there? Hope this made sense, too deep in other stuff now to try things out myself. Show quoted text
> On 13 Sep 2016, at 14:29, Sam S. (via RT) <perl6-bugs-followup@perl.org> wrote: > > # New Ticket Created by Sam S. > # Please include the string: [perl #129263] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=129263 > > > > ➜ my $*a = 42; await start { say $*a } > 42 > > ➜ my $*a = 42; await start { await start { say $*a } } > Dynamic variable $*foo not found > > IRC discussion (rearranged for clarity): > > <smls> Are threads supposed to see dynamic variables declared in the > mainline prior to starting the thread? > > <jnthn> A start block will go the extra mile to make that happen > <jnthn> It just takes the CALLER:: of whatever calls Promise.start iirc > > <jnthn> But if you work directly with threads then every one has its > own fresh dynamic scope > > ... > > <smls> Should that still work, when it's 2 levels deep into `start`? > > <jnthn> Umm...I guess it'd be nice if it worked. > <jnthn> Can RT it; I don't see why we can't fix that.
Subject: Re: [perl #129263] [CONC] Outer dynamic variable not found in nested `start` block
From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
To: Elizabeth Mattijsen <liz [...] dijkmat.nl>, "Sam S. (via RT)" <perl6-bugs-followup [...] perl.org>
Date: Wed, 14 Sep 2016 12:21:57 +0000
Download (untitled) / with headers
text/plain 1.6k

On Tue, Sep 13, 2016 at 11:13 PM Elizabeth Mattijsen <liz@dijkmat.nl> wrote:
Show quoted text
Feels to me some kind of loop would need to be made around line 33 in src/core/stubs.pm, basically looping until we either find the dynamic variable, or look for a $*PROMISE in the context and if so, try to find it there?

Hope this made sense, too deep in other stuff now to try things out myself.

> On 13 Sep 2016, at 14:29, Sam S. (via RT) <perl6-bugs-followup@perl.org> wrote:
>
> # New Ticket Created by  Sam S.
> # Please include the string:  [perl #129263]
> # in the subject line of all future correspondence about this issue.
> # <URL: https://rt.perl.org/Ticket/Display.html?id=129263 >
>
>
>    ➜  my $*a = 42;  await start { say $*a }
>    42
>
>    ➜  my $*a = 42;  await start { await start { say $*a } }
>    Dynamic variable $*foo not found
>
> IRC discussion (rearranged for clarity):
>
>    <smls>  Are threads supposed to see dynamic variables declared in the
>            mainline prior to starting the thread?
>
>    <jnthn> A start block will go the extra mile to make that happen
>    <jnthn> It just takes the CALLER:: of whatever calls Promise.start iirc
>
>    <jnthn> But if you work directly with threads then every one has its
>            own fresh dynamic scope
>
>    ...
>
>    <smls>  Should that still work, when it's 2 levels deep into `start`?
>
>    <jnthn> Umm...I guess it'd be nice if it worked.
>    <jnthn> Can RT it; I don't see why we can't fix that.



This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org