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 use &[+] in infix:<...> series in Rakudo #1871

Closed
p6rt opened this issue Jun 24, 2010 · 6 comments
Closed

Can't use &[+] in infix:<...> series in Rakudo #1871

p6rt opened this issue Jun 24, 2010 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Jun 24, 2010

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

Searchable as RT76046$

@p6rt
Copy link
Author

p6rt commented Jun 24, 2010

From @masak

<masak> rakudo​: say ~(1, 1, &[+] ... *)[^10]
<p6eval> rakudo 11cbd4​: OUTPUT«get_attr_str() not implemented in class
'Perl6MultiSub'␤ in 'infix​:<...>' at line 1 [...]
* masak submits rakuodbug
<colomon> rakudo​: say ~(1, 1, &[+] ... 50)
<p6eval> rakudo 11cbd4​: OUTPUT«get_attr_str() not implemented in class
'Perl6MultiSub'␤ in 'infix​:<...>' at line 1 [...]
<colomon> rakudo​: say ~(1, 1, *+* ... 50)
<p6eval> rakudo 11cbd4​: OUTPUT«1 1 2 3 5 8 13 21 34␤»
<moritz_> I guess it's related to &[+] referring to a multi
<colomon> moritz_​: yes
<colomon> I'm not sure the &[+] can actually work here.
<masak> why not?
<colomon> ... needs to know how many arguments the closure takes.
<masak> ah.
<colomon> how many does &[+] take?
<masak> two.
<colomon> or zero
<masak> zero!?
<moritz_> for [+] to return 0
<colomon> rakudo​: say infix​:<+>()
<p6eval> rakudo 11cbd4​: OUTPUT«0␤»
<masak> huh.
<TimToady> &[+] is specced to choose the 2-arg case
<masak> that settles it. thanks.
<colomon> there's the bug, then. :)
<TimToady> S03​:4686

@p6rt
Copy link
Author

p6rt commented Jul 29, 2010

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

@p6rt
Copy link
Author

p6rt commented Aug 11, 2010

From patrick.abisalloum@gmail.com

On Thu Jun 24 05​:18​:07 2010, masak wrote​:

<masak> rakudo​: say ~(1, 1, &[+] ... *)[^10]
<p6eval> rakudo 11cbd4​: OUTPUT«get_attr_str() not implemented in class
'Perl6MultiSub'␤ in 'infix​:<...>' at line 1 [...]
* masak submits rakuodbug
<colomon> rakudo​: say ~(1, 1, &[+] ... 50)
<p6eval> rakudo 11cbd4​: OUTPUT«get_attr_str() not implemented in class
'Perl6MultiSub'␤ in 'infix​:<...>' at line 1 [...]
<colomon> rakudo​: say ~(1, 1, *+* ... 50)
<p6eval> rakudo 11cbd4​: OUTPUT«1 1 2 3 5 8 13 21 34␤»
<moritz_> I guess it's related to &[+] referring to a multi
<colomon> moritz_​: yes
<colomon> I'm not sure the &[+] can actually work here.
<masak> why not?
<colomon> ... needs to know how many arguments the closure takes.
<masak> ah.
<colomon> how many does &[+] take?
<masak> two.
<colomon> or zero
<masak> zero!?
<moritz_> for [+] to return 0
<colomon> rakudo​: say infix​:<+>()
<p6eval> rakudo 11cbd4​: OUTPUT«0␤»
<masak> huh.
<TimToady> &[+] is specced to choose the 2-arg case
<masak> that settles it. thanks.
<colomon> there's the bug, then. :)
<TimToady> S03​:4686

This can be narrowed down to
[19​:50] <patrickas> rakudo​: my $foo = &prefix​:<!>;say $foo.signature;
[19​:51] <+p6eval> rakudo a47c45​: OUTPUT«get_attr_str() not implemented
in class 'Perl6MultiSub'␤ in main program body at line 1␤»

@p6rt
Copy link
Author

p6rt commented Oct 22, 2011

From @coke

On Thu Jun 24 05​:18​:07 2010, masak wrote​:

<masak> rakudo​: say ~(1, 1, &[+] ... *)[^10]
<p6eval> rakudo 11cbd4​: OUTPUT«get_attr_str() not implemented in class
'Perl6MultiSub'␤ in 'infix​:<...>' at line 1 [...]
* masak submits rakuodbug
<colomon> rakudo​: say ~(1, 1, &[+] ... 50)
<p6eval> rakudo 11cbd4​: OUTPUT«get_attr_str() not implemented in class
'Perl6MultiSub'␤ in 'infix​:<...>' at line 1 [...]
<colomon> rakudo​: say ~(1, 1, *+* ... 50)
<p6eval> rakudo 11cbd4​: OUTPUT«1 1 2 3 5 8 13 21 34␤»
<moritz_> I guess it's related to &[+] referring to a multi
<colomon> moritz_​: yes
<colomon> I'm not sure the &[+] can actually work here.
<masak> why not?
<colomon> ... needs to know how many arguments the closure takes.
<masak> ah.
<colomon> how many does &[+] take?
<masak> two.
<colomon> or zero
<masak> zero!?
<moritz_> for [+] to return 0
<colomon> rakudo​: say infix​:<+>()
<p6eval> rakudo 11cbd4​: OUTPUT«0␤»
<masak> huh.
<TimToady> &[+] is specced to choose the 2-arg case
<masak> that settles it. thanks.
<colomon> there's the bug, then. :)
<TimToady> S03​:4686

These are all happy now​:

22​:20 < [Coke]> rakudo​: say ~(1, 1, &[+] ... *)[^10]
22​:20 <+p6eval> rakudo 142c41​: OUTPUT«1 1 2 3 5 8 13 21 34 55␤»
22​:20 < [Coke]> rakudo​: say ~(1, 1, &[+] ... 50)
22​:21 <+p6eval> rakudo 142c41​: OUTPUT«(timeout)»
22​:21 < [Coke]> rakudo​: say ~(1, 1, &[+] ... 55)
22​:21 <+p6eval> rakudo 142c41​: OUTPUT«1 1 2 3 5 8 13 21 34 55␤»
22​:21 < [Coke]> rakudo​: my $foo = &prefix​:<!>;say $foo.signature;
22​:21 <+p6eval> rakudo 142c41​: OUTPUT«​:(Any)␤»

Closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 6, 2012

From @moritz

We've been running and passing tests for that in
t/spec/S03-sequence/basic.t for quite a while now, resolving...

@p6rt
Copy link
Author

p6rt commented Jan 6, 2012

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