Navigation Menu

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

return should apply to the lexically enclosing routine, map is no exception #465

Closed
p6rt opened this issue Dec 7, 2008 · 7 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Dec 7, 2008

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

Searchable as RT61126$

@p6rt
Copy link
Author

p6rt commented Dec 7, 2008

From daniel@ruoso.com

The following two snippets of code are supposed to behave the same​:

sub bar($code) { $code() };
sub foo { bar { return 1 }; return 2; }; say foo;

and

sub foo { map { return 1 }, 1; return 2 }; say foo;

both are supposed to return "1".

For some reason, map is being handled specially, while it is supposed to
be dispatched as any regular sub.

daniel

@p6rt
Copy link
Author

p6rt commented Apr 23, 2010

From @bbkr

on Moscow build​:

perl6 -e 'sub bar($code) { $code() }; sub foo { bar { return 1 }; return
2; }; say foo;'
2

perl6 -e 'sub foo { map { return 1 }, 1; return 2 }; say foo;'
2

@p6rt
Copy link
Author

p6rt commented Jul 28, 2010

@coke - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 1, 2011

From @pmichaud

Now fixed in nom dc16a4f -- needs test verification and then ticket can
be closed.

Pm

@p6rt
Copy link
Author

p6rt commented Sep 14, 2011

From @tadzik

On Fri Jul 01 14​:11​:43 2011, pmichaud wrote​:

Now fixed in nom dc16a4f -- needs test verification and then ticket can
be closed.

Not really fixed it seems​:

perl6 -e 'sub foo { map { return 1 }, 1; return 2 }; say foo;'
2

This is perl6 version 2011.04-1914-gf2857b7 built on parrot 3.7.0
revision RELEASE_3_7_0-246-gac4409f

@p6rt
Copy link
Author

p6rt commented Sep 14, 2011

From @tadzik

On Wed Sep 14 14​:34​:08 2011, tadzik wrote​:

Not really fixed it seems

The problem was with map being lazy. Proper test added in
Raku/roast@2d28aa2de6, closable now.

@p6rt
Copy link
Author

p6rt commented Sep 14, 2011

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

@p6rt p6rt closed this as completed Sep 14, 2011
@p6rt p6rt added the testneeded label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant