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

Meta operators on infix operators aren't accessible as subs #2203

Closed
p6rt opened this issue Oct 3, 2010 · 8 comments
Closed

Meta operators on infix operators aren't accessible as subs #2203

p6rt opened this issue Oct 3, 2010 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Oct 3, 2010

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

Searchable as RT78188$

@p6rt
Copy link
Author

p6rt commented Oct 3, 2010

From @ashgti

$ perl6

&infix​:<Xxx>
Could not find sub &infix​:<Xxx>
1 Xxx 2
1 1

<TimToady> so Xxx really means something like crosswith(&infix​:<xx>)
<TimToady> however, a p6 implementation should be able to generate
&infix​:<Xxx> at need

So, there should be some &infix​:<Xxx> function generated, somehow...

I am not sure how to generate those, because Meta-ops can be repeated, but
just filling the bug report so people know about the issue.

--
John Harrison

@p6rt
Copy link
Author

p6rt commented Oct 22, 2011

From @coke

No change in last year.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 22, 2011

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

@p6rt
Copy link
Author

p6rt commented Jan 4, 2015

From @usev6

On Sun Oct 03 10​:35​:17 2010, ash_gti wrote​:

$ perl6

&infix​:<Xxx>
Could not find sub &infix​:<Xxx>
1 Xxx 2
1 1

<TimToady> so Xxx really means something like crosswith(&infix​:<xx>)
<TimToady> however, a p6 implementation should be able to generate
&infix​:<Xxx> at need

So, there should be some &infix​:<Xxx> function generated, somehow...

I am not sure how to generate those, because Meta-ops can be repeated, but
just filling the bug report so people know about the issue.

--
John Harrison

I'm not sure I understand this correctly, but doesn't TimToady++'s explanation mean, that the current implementation (which is unchanged) is correct and this is not a bug?

It's possible to define an infix​:<Xxx> with rakudo, like

$ perl6-m -e 'sub infix​:<Xxx> ($a, *@​b) { return 42 }; say 2 Xxx <foo bar>'
42

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jan 4, 2015

From @usev6

On Sun Oct 03 10​:35​:17 2010, ash_gti wrote​:

$ perl6

&infix​:<Xxx>
Could not find sub &infix​:<Xxx>
1 Xxx 2
1 1

<TimToady> so Xxx really means something like crosswith(&infix​:<xx>)
<TimToady> however, a p6 implementation should be able to generate
&infix​:<Xxx> at need

So, there should be some &infix​:<Xxx> function generated, somehow...

I am not sure how to generate those, because Meta-ops can be repeated, but
just filling the bug report so people know about the issue.

--
John Harrison

I'm not sure I understand this correctly, but doesn't TimToady++'s explanation mean, that the current implementation (which is unchanged) is correct and this is not a bug?

It's possible to define an infix​:<Xxx> with rakudo, like

$ perl6-m -e 'sub infix​:<Xxx> ($a, *@​b) { return 42 }; say 2 Xxx <foo bar>'
42

@p6rt
Copy link
Author

p6rt commented Aug 16, 2015

From @FROGGS

I understand TimToady in a way which would imply that rakudo would autogenerate an &infix​:<Xxx> if it is requested by the user...
Though I'm not sure I'd like to see that happen :o)

Here is a workaround though​:

m​: my &infix​:<Xxx> = &infix​:<X>;
&[Xxx].assuming(&[xx]);
say ((1, 2) Xxx (3, 4)).perl
rakudo-moar f185e0​: OUTPUT«((1, 3), (1, 4), (2, 3), (2, 4))␤»

@p6rt
Copy link
Author

p6rt commented Jul 14, 2016

From @zoffixznet

This now works as described.

Tests added​: Raku/roast@8e585a4365

@p6rt
Copy link
Author

p6rt commented Jul 14, 2016

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