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 call Callable objects in a list in parallel using the >>.() [or >>()] form in Rakudo #2138

Closed
p6rt opened this issue Sep 4, 2010 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Sep 4, 2010

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

Searchable as RT77668$

@p6rt
Copy link
Author

p6rt commented Sep 4, 2010

From @masak

<JimmyZ> rakudo​: sub infix​:<+-*/>($a, $b) { ( { $a + $b }, { $a - $b
}, { $a * $b }, { $a / $b } )>>.() }; say 5+-*/2;
<p6eval> rakudo 52f9ea​: OUTPUT«Tried to find null name␤ in 'infix​:<+-*/>' [...]
<JimmyZ> 这个代码有什么错误?
<masak> I don't know. It's related to the >>.(), to be sure.
<JimmyZ> yes
<masak> but I'm not sure if it should be allowed or no.
<masak> rakudo​: say ( { 1 + 1 }, { 2 + 2 } )>>.()
<p6eval> rakudo 52f9ea​: OUTPUT«Tried to find null name [...]
<masak> rakudo​: say ( { 1 + 1 }, { 2 + 2 } )>>()
<p6eval> rakudo 52f9ea​: OUTPUT«Tried to find null name [...]
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Feb 13, 2012

From @coke

On Fri Sep 03 21​:48​:08 2010, masak wrote​:

<JimmyZ> rakudo​: sub infix​:<+-*/>($a, $b) { ( { $a + $b }, { $a - $b
}, { $a * $b }, { $a / $b } )>>.() }; say 5+-*/2;
<p6eval> rakudo 52f9ea​: OUTPUT«Tried to find null name␤ in 'infix​:<+-
*/>' [...]
<JimmyZ> 这个代码有什么错误?
<masak> I don't know. It's related to the >>.(), to be sure.
<JimmyZ> yes
<masak> but I'm not sure if it should be allowed or no.
<masak> rakudo​: say ( { 1 + 1 }, { 2 + 2 } )>>.()
<p6eval> rakudo 52f9ea​: OUTPUT«Tried to find null name [...]
<masak> rakudo​: say ( { 1 + 1 }, { 2 + 2 } )>>()
<p6eval> rakudo 52f9ea​: OUTPUT«Tried to find null name [...]
* masak submits rakudobug

The first one (perhaps correctly) now gives a whatever code.
The second one works. The third one still fails, but differently.

22​:05 < [Coke]> rakudo​: sub infix​:<+-*/>($a, $b) { ( { $a + $b }, { $a - $b },
  { $a * $b }, { $a / $b } )>>.() }; say 5+-*/2
22​:05 <+p6eval> rakudo 29f5cf​: OUTPUT«WhateverCode.new()␤»
22​:05 < [Coke]> rakudo​: say ( { 1 + 1 }, { 2 + 2 } )>>.()
22​:05 <+p6eval> rakudo 29f5cf​: OUTPUT«2 4␤»
22​:05 < [Coke]> rakudo​: say ( { 1 + 1 }, { 2 + 2 } )>>()
22​:05 <+p6eval> rakudo 29f5cf​: OUTPUT«===SORRY!===␤Method 'isa' not found for
  invocant of class 'Undef'␤»

The failure on the third one looks plausible, though. Is this closable with tests?

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Feb 13, 2012

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

@p6rt
Copy link
Author

p6rt commented Oct 13, 2014

From @usev6

Now the first code snippet also seems to work​:

$ perl6-m -e 'sub infix​:<+-*/>($a, $b) { ( { $a + $b }, { $a - $b }, { $a * $b }, { $a / $b } )>>.() }; say 5+-*/2;'
7 3 10 2.5

I added a test for that one to S03-metaops/hyper.t with the following commit​: Raku/roast@85bf9926a1

The second example works as well (cmp. also ticket #​77670)​:

$ perl6-m -e 'say ( { 1 + 1 }, { 2 + 2 } )>>.()'
2 4

I assume that the third example is not supposed to work. If that's wrong please reopen the ticket.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 13, 2014

From @usev6

Now the first code snippet also seems to work​:

$ perl6-m -e 'sub infix​:<+-*/>($a, $b) { ( { $a + $b }, { $a - $b }, { $a * $b }, { $a / $b } )>>.() }; say 5+-*/2;'
7 3 10 2.5

I added a test for that one to S03-metaops/hyper.t with the following commit​: Raku/roast@85bf9926a1

The second example works as well (cmp. also ticket #​77670)​:

$ perl6-m -e 'say ( { 1 + 1 }, { 2 + 2 } )>>.()'
2 4

I assume that the third example is not supposed to work. If that's wrong please reopen the ticket.

@p6rt p6rt closed this as completed Oct 13, 2014
@p6rt
Copy link
Author

p6rt commented Oct 13, 2014

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