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 write infix:�<� as infix:<< < >> in Rakudo #2697

Closed
p6rt opened this issue Apr 4, 2012 · 5 comments
Closed

Can't write infix:�<� as infix:<< < >> in Rakudo #2697

p6rt opened this issue Apr 4, 2012 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Apr 4, 2012

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

Searchable as RT112234$

@p6rt
Copy link
Author

p6rt commented Apr 4, 2012

From @masak

<colomon> r​: say 4 < 5 < 6 < 7
<p6eval> rakudo 4373f0​: OUTPUT«Trueâ�¤Â»
<colomon> r​: say 4 < 5 < 6 < 4
<p6eval> rakudo 4373f0​: OUTPUT«Falseâ�¤Â»
<masak> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(A, A) { False };
multi infix​:<< < >>(e1, e2) { True }; multi infix​:<< < >>(e2, e3) {
True }; multi infix​:<< < >>(e3, e1) { True }; say e1 < e2 < e3 < e1
<p6eval> rakudo 4373f0​: OUTPUT«Falseâ�¤Â»
<masak> aww :)
<masak> why doesn't the above work?
<tadzik> masak​: doesn't it?
<masak> no. read carefully what it does.
<tadzik> oh, right, it doesn't
<masak> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(e1, e2) { True }; say e1 < e2
<p6eval> rakudo 4373f0​: OUTPUT«Trueâ�¤Â»
<masak> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(e3, e1) { True }; say e3 < e1
<p6eval> rakudo 4373f0​: OUTPUT«Falseâ�¤Â»
<masak> there we go.
<masak> that's the bit that's failing.
<tadzik> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(A, A) { False };
multi infix​:<< < >>(e1, e2) { True }; multi infix​:<< < >>(e2, e3) {
True }; multi infix​:<< < >>(e3, e1) { die "LOL"; True }; say e1 < e2
< e3 < e1
<p6eval> rakudo 4373f0​: OUTPUT«Falseâ�¤Â»
<tadzik> yep
<masak> right.
<masak> it's never run at all.
<masak> r​: enum A <e1 e2>; sub foo(e1) { die "MATCHED" }; foo e1
<p6eval> rakudo 4373f0​: OUTPUT«MATCHEDâ�¤ in sub foo at
/tmp/E03yKbC5Z_​:1â�¤ in block <anon> at /tmp/E03yKbC5Z_​:1â�¤â�¤Â»
<masak> seems to be related to operators, then.
<tadzik> r​: enum A <e1>; multi prefix​:<->(e1) { die "AWW" }; say -e1
<p6eval> rakudo 4373f0​: OUTPUT«AWWâ�¤ in sub prefix​:<-> at
/tmp/LdnFrauMSw​:1â�¤ in block <anon> at /tmp/LdnFrauMSw​:1â�¤â�¤Â»
<colomon> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(e1, e2) { say
"hello!" }; say e1 < e2
<p6eval> rakudo 4373f0​: OUTPUT«Trueâ�¤Â»
<tadzik> r​: enum A <e1 e2>; multi infix​:<->(e1, e2) { die "AWW" }; say e1 - e2
<p6eval> rakudo 4373f0​: OUTPUT«AWWâ�¤ in sub infix​:<-> at
/tmp/tvYdwSv0aA​:1â�¤ in block <anon> at /tmp/tvYdwSv0aA​:1â�¤â�¤Â»
<tadzik> hmm
<colomon> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(A, A) { say
"hello!" }; say e1 < e2
<p6eval> rakudo 4373f0​: OUTPUT«Trueâ�¤Â»
<colomon> r​: enum A <e1 e2>; multi infix​:<< - >>(e1, e2) { die "AWW"
}; say e1 - e2
<p6eval> rakudo 4373f0​: OUTPUT«-1â�¤Â»
<colomon> think that's your problem
<colomon> r​: enum A <e1 e2 e3>; multi infix​:«<»(A, A) { say "hello!"
}; say e1 < e2
<p6eval> rakudo 4373f0​: OUTPUT«hello!â�¤Trueâ�¤Â»
<colomon> yup
* masak submits rakudobug
<masak> tadzik++ colomon++ # golfing

Note particularly that the third-last evaluation (with multi infix​:<<
< >>) doesn't work as intended, whereas the last one (with multi
infix​:«<») does.

@p6rt
Copy link
Author

p6rt commented Nov 5, 2012

From @jnthn

On Wed Apr 04 04​:10​:55 2012, masak wrote​:

<colomon> r​: say 4 < 5 < 6 < 7
<p6eval> rakudo 4373f0​: OUTPUT«Trueâ�¤Â»
<colomon> r​: say 4 < 5 < 6 < 4
<p6eval> rakudo 4373f0​: OUTPUT«Falseâ�¤Â»
<masak> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(A, A) { False };
multi infix​:<< < >>(e1, e2) { True }; multi infix​:<< < >>(e2, e3) {
True }; multi infix​:<< < >>(e3, e1) { True }; say e1 < e2 < e3 < e1
<p6eval> rakudo 4373f0​: OUTPUT«Falseâ�¤Â»
<masak> aww :)
<masak> why doesn't the above work?
<tadzik> masak​: doesn't it?
<masak> no. read carefully what it does.
<tadzik> oh, right, it doesn't
<masak> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(e1, e2) { True };
say e1 < e2
<p6eval> rakudo 4373f0​: OUTPUT«Trueâ�¤Â»
<masak> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(e3, e1) { True };
say e3 < e1
<p6eval> rakudo 4373f0​: OUTPUT«Falseâ�¤Â»
<masak> there we go.
<masak> that's the bit that's failing.
<tadzik> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(A, A) { False };
multi infix​:<< < >>(e1, e2) { True }; multi infix​:<< < >>(e2, e3) {
True }; multi infix​:<< < >>(e3, e1) { die "LOL"; True }; say e1 < e2
< e3 < e1
<p6eval> rakudo 4373f0​: OUTPUT«Falseâ�¤Â»
<tadzik> yep
<masak> right.
<masak> it's never run at all.
<masak> r​: enum A <e1 e2>; sub foo(e1) { die "MATCHED" }; foo e1
<p6eval> rakudo 4373f0​: OUTPUT«MATCHEDâ�¤ in sub foo at
/tmp/E03yKbC5Z_​:1â�¤ in block <anon> at /tmp/E03yKbC5Z_​:1â�¤â�¤Â»
<masak> seems to be related to operators, then.
<tadzik> r​: enum A <e1>; multi prefix​:<->(e1) { die "AWW" }; say -e1
<p6eval> rakudo 4373f0​: OUTPUT«AWWâ�¤ in sub prefix​:<-> at
/tmp/LdnFrauMSw​:1â�¤ in block <anon> at /tmp/LdnFrauMSw​:1â�¤â�¤Â»
<colomon> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(e1, e2) { say
"hello!" }; say e1 < e2
<p6eval> rakudo 4373f0​: OUTPUT«Trueâ�¤Â»
<tadzik> r​: enum A <e1 e2>; multi infix​:<->(e1, e2) { die "AWW" }; say
e1 - e2
<p6eval> rakudo 4373f0​: OUTPUT«AWWâ�¤ in sub infix​:<-> at
/tmp/tvYdwSv0aA​:1â�¤ in block <anon> at /tmp/tvYdwSv0aA​:1â�¤â�¤Â»
<tadzik> hmm
<colomon> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(A, A) { say
"hello!" }; say e1 < e2
<p6eval> rakudo 4373f0​: OUTPUT«Trueâ�¤Â»
<colomon> r​: enum A <e1 e2>; multi infix​:<< - >>(e1, e2) { die "AWW"
}; say e1 - e2
<p6eval> rakudo 4373f0​: OUTPUT«-1â�¤Â»
<colomon> think that's your problem
<colomon> r​: enum A <e1 e2 e3>; multi infix​:«<»(A, A) { say "hello!"
}; say e1 < e2
<p6eval> rakudo 4373f0​: OUTPUT«hello!â�¤Trueâ�¤Â»
<colomon> yup
* masak submits rakudobug
<masak> tadzik++ colomon++ # golfing

Note particularly that the third-last evaluation (with multi infix​:<<
< >>) doesn't work as intended, whereas the last one (with multi
infix​:«<») does.

Works these days​:

enum A <e1 e2>; multi infix​:<< - >>(e1, e2) { die "AWW" }; say e1 - e2
AWW

Tagging testneeded.

/jnthn

@p6rt
Copy link
Author

p6rt commented Nov 5, 2012

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

@p6rt
Copy link
Author

p6rt commented Jan 14, 2014

From @coke

On Mon Nov 05 14​:27​:29 2012, jnthn@​jnthn.net wrote​:

On Wed Apr 04 04​:10​:55 2012, masak wrote​:

<colomon> r​: say 4 < 5 < 6 < 7
<p6eval> rakudo 4373f0​: OUTPUT«Trueâ�¤Â»
<colomon> r​: say 4 < 5 < 6 < 4
<p6eval> rakudo 4373f0​: OUTPUT«Falseâ�¤Â»
<masak> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(A, A) { False };
multi infix​:<< < >>(e1, e2) { True }; multi infix​:<< < >>(e2, e3) {
True }; multi infix​:<< < >>(e3, e1) { True }; say e1 < e2 < e3 < e1
<p6eval> rakudo 4373f0​: OUTPUT«Falseâ�¤Â»
<masak> aww :)
<masak> why doesn't the above work?
<tadzik> masak​: doesn't it?
<masak> no. read carefully what it does.
<tadzik> oh, right, it doesn't
<masak> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(e1, e2) { True };
say e1 < e2
<p6eval> rakudo 4373f0​: OUTPUT«Trueâ�¤Â»
<masak> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(e3, e1) { True };
say e3 < e1
<p6eval> rakudo 4373f0​: OUTPUT«Falseâ�¤Â»
<masak> there we go.
<masak> that's the bit that's failing.
<tadzik> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(A, A) { False };
multi infix​:<< < >>(e1, e2) { True }; multi infix​:<< < >>(e2, e3) {
True }; multi infix​:<< < >>(e3, e1) { die "LOL"; True }; say e1 < e2
< e3 < e1
<p6eval> rakudo 4373f0​: OUTPUT«Falseâ�¤Â»
<tadzik> yep
<masak> right.
<masak> it's never run at all.
<masak> r​: enum A <e1 e2>; sub foo(e1) { die "MATCHED" }; foo e1
<p6eval> rakudo 4373f0​: OUTPUT«MATCHEDâ�¤ in sub foo at
/tmp/E03yKbC5Z_​:1â�¤ in block <anon> at /tmp/E03yKbC5Z_​:1â�¤â�¤Â»
<masak> seems to be related to operators, then.
<tadzik> r​: enum A <e1>; multi prefix​:<->(e1) { die "AWW" }; say -e1
<p6eval> rakudo 4373f0​: OUTPUT«AWWâ�¤ in sub prefix​:<-> at
/tmp/LdnFrauMSw​:1â�¤ in block <anon> at /tmp/LdnFrauMSw​:1â�¤â�¤Â»
<colomon> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(e1, e2) { say
"hello!" }; say e1 < e2
<p6eval> rakudo 4373f0​: OUTPUT«Trueâ�¤Â»
<tadzik> r​: enum A <e1 e2>; multi infix​:<->(e1, e2) { die "AWW" }; say
e1 - e2
<p6eval> rakudo 4373f0​: OUTPUT«AWWâ�¤ in sub infix​:<-> at
/tmp/tvYdwSv0aA​:1â�¤ in block <anon> at /tmp/tvYdwSv0aA​:1â�¤â�¤Â»
<tadzik> hmm
<colomon> r​: enum A <e1 e2 e3>; multi infix​:<< < >>(A, A) { say
"hello!" }; say e1 < e2
<p6eval> rakudo 4373f0​: OUTPUT«Trueâ�¤Â»
<colomon> r​: enum A <e1 e2>; multi infix​:<< - >>(e1, e2) { die "AWW"
}; say e1 - e2
<p6eval> rakudo 4373f0​: OUTPUT«-1â�¤Â»
<colomon> think that's your problem
<colomon> r​: enum A <e1 e2 e3>; multi infix​:«<»(A, A) { say "hello!"
}; say e1 < e2
<p6eval> rakudo 4373f0​: OUTPUT«hello!â�¤Trueâ�¤Â»
<colomon> yup
* masak submits rakudobug
<masak> tadzik++ colomon++ # golfing

Note particularly that the third-last evaluation (with multi infix​:<<
< >>) doesn't work as intended, whereas the last one (with multi
infix​:«<») does.

Works these days​:

enum A <e1 e2>; multi infix​:<< - >>(e1, e2) { die "AWW" }; say e1 - e2
AWW

Tagging testneeded.

/jnthn

Added new test file, S03-operators/custom.t

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 14, 2014

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