Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable scopes with 'start' block #4246

Closed
p6rt opened this issue May 14, 2015 · 4 comments
Closed

Variable scopes with 'start' block #4246

p6rt opened this issue May 14, 2015 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented May 14, 2015

Migrated from rt.perl.org#125196 (status was 'resolved')

Searchable as RT125196$

@p6rt
Copy link
Author

p6rt commented May 14, 2015

From tony.odell@live.com

CODE​:


my $promise = start { sleep 1; $*E.say;};
my $*E = 5;
await $promise;


EXPECTED​:
-----------------------------------------5-----------------------------------------
ACTUAL​:
-----------------------------------------===SORRY!===Dynamic variable $*E not found-----------------------------------------
Other notes​:
Putting the 'my $*E'... before the start block has same output
Changing $*E to $E yields​:
-----------------------------------------(Any)-----------------------------------------
Changing $*E to $E *and* moving the declaration to prior to the start block yields expected output.

@p6rt
Copy link
Author

p6rt commented Nov 23, 2015

From @jnthn

On Thu May 14 12​:49​:54 2015, tony.odell@​live.com wrote​:

CODE​:
-----------------------------------------
my $promise = start { sleep 1; $*E.say;};
my $*E = 5;
await $promise;
-----------------------------------------
EXPECTED​:
-----------------------------------------
5-----------------------------------------
ACTUAL​:
-----------------------------------------
===SORRY!===Dynamic variable
$*E not found
-----------------------------------------

Fixed, and tests added in S17-promise/start.t.

/jnthn

@p6rt
Copy link
Author

p6rt commented Nov 23, 2015

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt closed this as completed Nov 23, 2015
@p6rt
Copy link
Author

p6rt commented Nov 23, 2015

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant