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

'when' blocks allowed without an intervening semicolon in Rakudo #2986

Closed
p6rt opened this issue Dec 1, 2012 · 5 comments
Closed

'when' blocks allowed without an intervening semicolon in Rakudo #2986

p6rt opened this issue Dec 1, 2012 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Dec 1, 2012

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

Searchable as RT115964$

@p6rt
Copy link
Author

p6rt commented Dec 1, 2012

From @masak

<cedrvint> r​: my $bar = 'test'; my $foo0 = { given $bar { when Real {
1 } when Str { 2 } } }; $foo0().say;
<p6eval> rakudo da6569​: OUTPUT«2␤»
<masak> or use 'do'.
<masak> r​: my $bar = 'test'; my $foo0 = do given $bar { when Real { 1
}; when Str { 2 } }; say $foo0
<p6eval> rakudo da6569​: OUTPUT«2␤»
<cedrvint> masak++
<masak> also, I'm surprised Rakudo doesn't complain about the lack of
semicolon between your 'when's.
<masak> that's quite possibly a bug.
<masak> std​: given 1 { when Real { 1 } when Str { 2 } }
<p6eval> std a8bc48f​: OUTPUT«===SORRY!===␤Strange text after block
(missing comma, semicolon, comment marker?) [...]
* masak submits rakudobug
<cedrvint> don't! :)
<cedrvint> it would break my code ;)
<masak> ;)
<masak> sorry, I simply have to.

@p6rt
Copy link
Author

p6rt commented Mar 11, 2013

From @jnthn

On Sat Dec 01 13​:39​:34 2012, masak wrote​:

<cedrvint> r​: my $bar = 'test'; my $foo0 = { given $bar { when Real {
1 } when Str { 2 } } }; $foo0().say;
<p6eval> rakudo da6569​: OUTPUT«2␤»
<masak> or use 'do'.
<masak> r​: my $bar = 'test'; my $foo0 = do given $bar { when Real { 1
}; when Str { 2 } }; say $foo0
<p6eval> rakudo da6569​: OUTPUT«2␤»
<cedrvint> masak++
<masak> also, I'm surprised Rakudo doesn't complain about the lack of
semicolon between your 'when's.
<masak> that's quite possibly a bug.
<masak> std​: given 1 { when Real { 1 } when Str { 2 } }
<p6eval> std a8bc48f​: OUTPUT«===SORRY!===␤Strange text after block
(missing comma, semicolon, comment marker?) [...]
* masak submits rakudobug
<cedrvint> don't! :)
<cedrvint> it would break my code ;)
<masak> ;)
<masak> sorry, I simply have to.

Fails properly now​:

given 1 { when Real { 1 } when Str { 2 } }
===SORRY!===
Confused
at <unknown file>​:1
------> given 1 { when Real { 1 } <HERE>when Str { 2 } }

Tagging testneeded.

/jnthn

@p6rt
Copy link
Author

p6rt commented Mar 11, 2013

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

@p6rt
Copy link
Author

p6rt commented Jan 25, 2014

From @peschwa

Am Mo 11. Mär 2013, 12​:38​:22, jnthn@​jnthn.net schrieb​:

On Sat Dec 01 13​:39​:34 2012, masak wrote​:

<cedrvint> r​: my $bar = 'test'; my $foo0 = { given $bar { when Real {
1 } when Str { 2 } } }; $foo0().say;
<p6eval> rakudo da6569​: OUTPUT«2␤»
<masak> or use 'do'.
<masak> r​: my $bar = 'test'; my $foo0 = do given $bar { when Real { 1
}; when Str { 2 } }; say $foo0
<p6eval> rakudo da6569​: OUTPUT«2␤»
<cedrvint> masak++
<masak> also, I'm surprised Rakudo doesn't complain about the lack of
semicolon between your 'when's.
<masak> that's quite possibly a bug.
<masak> std​: given 1 { when Real { 1 } when Str { 2 } }
<p6eval> std a8bc48f​: OUTPUT«===SORRY!===␤Strange text after block
(missing comma, semicolon, comment marker?) [...]
* masak submits rakudobug
<cedrvint> don't! :)
<cedrvint> it would break my code ;)
<masak> ;)
<masak> sorry, I simply have to.

Fails properly now​:

given 1 { when Real { 1 } when Str { 2 } }
===SORRY!===
Confused
at <unknown file>​:1
------> given 1 { when Real { 1 } <HERE>when Str { 2 } }

Tagging testneeded.

/jnthn

Add a test to roast in commit 1b0f074 as per the example above.

@p6rt p6rt closed this as completed Jan 26, 2014
@p6rt
Copy link
Author

p6rt commented Jan 26, 2014

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

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