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

Can't have a '-->' after a parameter with a 'where' clause in Rakudo #1875

Closed
p6rt opened this issue Jun 25, 2010 · 10 comments
Closed

Can't have a '-->' after a parameter with a 'where' clause in Rakudo #1875

p6rt opened this issue Jun 25, 2010 · 10 comments

Comments

@p6rt
Copy link

p6rt commented Jun 25, 2010

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

Searchable as RT76096$

@p6rt
Copy link
Author

p6rt commented Jun 25, 2010

From @masak

<masak> rakudo​: sub foo($x where 1 --> Int) {}
<p6eval> rakudo 4e6cce​: OUTPUT«===SORRY!===␤Missing block at line 11,
near "-> Int) {}"␤»
<masak> std​: sub foo($x where 1 --> Int) {}
<p6eval> std 31447​: OUTPUT«ok 00​:01 113m␤»
* masak submits rakudobug
<masak> seems 'where' and '-->' in signatures don't play well together
in Rakudo.
<moritz_> masak​: what about where { block } + --> ?
<masak> moritz_​: same ordeal.
<moritz_> rakudo​: sub foo($x where { $_ ~~ 1} --> Int) { }
<p6eval> rakudo 4e6cce​: OUTPUT«===SORRY!===␤Missing block at line 11,
near "-> Int) {"␤»
<masak> std​: sub foo($x where { $_ ~~ 1} --> Int) { }
<p6eval> std 31447​: OUTPUT«ok 00​:01 112m␤»
<masak> moritz_​: good you pointed that out. adding that to the ticket.
<masak> the block form was the way I discovered it. the 1 was the
golfed variant :)

@p6rt
Copy link
Author

p6rt commented Jul 29, 2010

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

@p6rt
Copy link
Author

p6rt commented Nov 13, 2010

From @masak

<masak> std​: sub foo(Str $s where "OH HAI" --> Int) { $s }
<p6eval> std a194beb​: OUTPUT«ok 00​:01 122m␤»
<masak> rakudo​: sub foo(Str $s --> Int) {}; sub bar(Str $s where "OH
HAI") {}; sub baz(Str $s where "OH HAI" --> Int) {}
<p6eval> rakudo c548b8​: OUTPUT«===SORRY!===␤Missing block at line 22,
near "-> Int) {}"␤»
<masak> STD handles --> after a 'where' block. Rakudo doesn't.
* masak submits rakudobug
<jnthn> rakudo​: sub foo(Str $s where "OH HAI" --> Int) { $s }
<p6eval> rakudo c548b8​: OUTPUT«===SORRY!===␤Missing block at line 22,
near "-> Int) { "␤»

jnthn++ suspected that we're missing a terminator​:<< --> >>, and his
suspicion turned out to be right. STD.pm6 has one; Rakudo doesn't.

@p6rt
Copy link
Author

p6rt commented Oct 11, 2011

From @coke

No substantial change​:

21​:08 < [Coke]> rakudo​: sub foo($x where 1 --> Int) {}
21​:08 <+p6eval> rakudo 38907e​: OUTPUT«===SORRY!===␤Missing block at line 1,
  near ") {}"␤»

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented May 29, 2012

From @diakopter

On Mon Oct 10 18​:09​:05 2011, coke wrote​:

No substantial change​:

21​:08 < [Coke]> rakudo​: sub foo($x where 1 --> Int) {}
21​:08 <+p6eval> rakudo 38907e​: OUTPUT«===SORRY!===␤Missing block at
line 1,
near ") {}"␤»

I *think* this has a much later duplicate... I might look for it later.

@p6rt
Copy link
Author

p6rt commented Apr 14, 2014

From @Mouq

On Tue May 29 12​:45​:31 2012, diakopter wrote​:

On Mon Oct 10 18​:09​:05 2011, coke wrote​:

No substantial change​:

21​:08 < [Coke]> rakudo​: sub foo($x where 1 --> Int) {}
21​:08 <+p6eval> rakudo 38907e​: OUTPUT«===SORRY!===␤Missing block at
line 1,
near ") {}"␤»

I *think* this has a much later duplicate... I might look for it later.

Seems fine now​:

00​:08 <Mouq> r​: sub foo($x where 1 --> Int) {}
00​:08 <camelia> rakudo-parrot 79167a, rakudo-jvm 79167a, rakudo-moar 79167a​: ( no output )

Closeable with tests

@p6rt
Copy link
Author

p6rt commented Jul 20, 2014

From @peschwa

On Sat Nov 13 08​:03​:53 2010, masak wrote​:

<masak> std​: sub foo(Str $s where "OH HAI" --> Int) { $s }
<p6eval> std a194beb​: OUTPUT«ok 00​:01 122m␤»
<masak> rakudo​: sub foo(Str $s --> Int) {}; sub bar(Str $s where "OH
HAI") {}; sub baz(Str $s where "OH HAI" --> Int) {}
<p6eval> rakudo c548b8​: OUTPUT«===SORRY!===␤Missing block at line 22,
near "-> Int) {}"␤»
<masak> STD handles --> after a 'where' block. Rakudo doesn't.
* masak submits rakudobug
<jnthn> rakudo​: sub foo(Str $s where "OH HAI" --> Int) { $s }
<p6eval> rakudo c548b8​: OUTPUT«===SORRY!===␤Missing block at line 22,
near "-> Int) { "␤»

jnthn++ suspected that we're missing a terminator​:<< --> >>, and his
suspicion turned out to be right. STD.pm6 has one; Rakudo doesn't.

Dup​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=76096

@p6rt
Copy link
Author

p6rt commented Jul 20, 2014

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

@p6rt
Copy link
Author

p6rt commented Jul 30, 2014

From @perlpilot

On Sun Apr 13 21​:08​:59 2014, Mouq wrote​:

On Tue May 29 12​:45​:31 2012, diakopter wrote​:

On Mon Oct 10 18​:09​:05 2011, coke wrote​:

No substantial change​:

21​:08 < [Coke]> rakudo​: sub foo($x where 1 --> Int) {}
21​:08 <+p6eval> rakudo 38907e​: OUTPUT«===SORRY!===␤Missing block
at
line 1,
near ") {}"␤»

I *think* this has a much later duplicate... I might look for it
later.

Seems fine now​:

00​:08 <Mouq> r​: sub foo($x where 1 --> Int) {}
00​:08 <camelia> rakudo-parrot 79167a, rakudo-jvm 79167a, rakudo-moar
79167a​: ( no output )

Closeable with tests

Tests added (see Raku/roast@b25116e)

-Scott

@p6rt
Copy link
Author

p6rt commented Jul 30, 2014

@perlpilot - 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