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

Non-associative operators mistakingly allowed in reduction meta-op #2251

Closed
p6rt opened this issue Nov 12, 2010 · 8 comments
Closed

Non-associative operators mistakingly allowed in reduction meta-op #2251

p6rt opened this issue Nov 12, 2010 · 8 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Nov 12, 2010

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

Searchable as RT79116$

@p6rt
Copy link
Author

p6rt commented Nov 12, 2010

From @colomon

rakudo​: say [leg] <a b c>
p6eval​: rakudo d85964​: OUTPUT«-1␤»

...but...

"Any infix operator (except for non-associating operators) can be
surrounded by square brackets in term position to create a list
operator that reduces using that operation..." [S03]

--
Solomon Foster​: colomon@​gmail.com
HarmonyWare, Inc​: http://www.harmonyware.com

@p6rt
Copy link
Author

p6rt commented Nov 20, 2012

From @FROGGS

Hi, what output do you expect? (I dont understand that quote...)

On Fr. 12. Nov. 2010, 07​:37​:03, Solomon wrote​:

rakudo​: say [leg] <a b c>
p6eval​: rakudo d85964​: OUTPUT«-1␤»

...but...

"Any infix operator (except for non-associating operators) can be
surrounded by square brackets in term position to create a list
operator that reduces using that operation..." [S03]

@p6rt
Copy link
Author

p6rt commented Nov 20, 2012

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

@p6rt
Copy link
Author

p6rt commented Nov 20, 2012

From @masak

On Fri Nov 12 07​:37​:03 2010, Solomon wrote​:

rakudo​: say [leg] <a b c>
p6eval​: rakudo d85964​: OUTPUT«-1␤»

...but...

"Any infix operator (except for non-associating operators) can be
surrounded by square brackets in term position to create a list
operator that reduces using that operation..." [S03]

<p6eval> rakudo bf472b​: OUTPUT«Increase␤»
<FROGGS> is that right? two years ago you got -1
<[Coke]> FROGGS​: -1 is to Increase like 1 is to True
<FROGGS> hmmm
<FROGGS> so its still wrong
<[Coke]> it's a builtin enum for comparisons that I think only rakudo
implements yet.
<FROGGS> I dont understand what I should get instead by reading
https://rt-archive.perl.org/perl6/Ticket/Display.html?id=79116
<[Coke]> r​: say +Increase
<p6eval> rakudo bf472b​: OUTPUT«-1␤»
<[Coke]> that ticket was opened by colomon; have him tell you the
expected output.
<[Coke]> (or, better, write a test)
<[Coke]> n​: say [leg] <a b c>
<p6eval> niecza v22-33-gda13155​: OUTPUT«===SORRY!===␤␤Cannot reduce
with leg because structural infix operators are diffy and not chaining
[...]
<[Coke]> r​: say [leg] <a q e>
<p6eval> rakudo bf472b​: OUTPUT«Increase␤»
<masak> oh! maybe leg is non-associating.
<masak> that might be what the ticket is hinting at.
<masak> it certainly doesn't say it outright.
<[Coke]> I think maybe leg isn't supposed to be amenable to meta-ing in
that fashion, perhaps.
<[Coke]> er, what masak said. :)
<[Coke]> std​: say [leg] <a q e>
<p6eval> std d38bbd0​: OUTPUT«===SORRY!===␤Cannot reduce with leg
because structural infix operators are diffy and not chaining [...]
<[Coke]> so, I think std and n have what the ticket is looking for here.
<masak> S03 agrees; infix​:<leg> is non-associating.
<masak> [Coke]​: *nod*
* masak adds this to the ticket

@p6rt
Copy link
Author

p6rt commented Nov 19, 2014

From @usev6

The output has changed, but it still doesn't die​:

$ perl6 -e 'say [leg] <a b c>'
Less

I added a test (fudged 'todo') to S03-metaops/reduce.t with commit Raku/roast@9078c34ec2

1 similar comment
@p6rt
Copy link
Author

p6rt commented Nov 19, 2014

From @usev6

The output has changed, but it still doesn't die​:

$ perl6 -e 'say [leg] <a b c>'
Less

I added a test (fudged 'todo') to S03-metaops/reduce.t with commit Raku/roast@9078c34ec2

@p6rt
Copy link
Author

p6rt commented Jan 27, 2015

From @Mouq

Fixed in Rakudo commits eea99e373876015fdcec8d8a7bbb921a205f0972 and b472a3e91453b53d8d17c9f750cccacd8ea0c0b0, and test updated in Roast commit fc421584583a0a6f089da2cdbb58b66c30958ba1

@p6rt
Copy link
Author

p6rt commented Jan 27, 2015

@Mouq - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Jan 27, 2015
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant