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

HyperWhatever does not work with reduction metaop ([+] **) #6015

Closed
p6rt opened this issue Jan 20, 2017 · 8 comments
Closed

HyperWhatever does not work with reduction metaop ([+] **) #6015

p6rt opened this issue Jan 20, 2017 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Jan 20, 2017

Migrated from rt.perl.org#130590 (status was 'rejected')

Searchable as RT130590$

@p6rt
Copy link
Author

p6rt commented Jan 20, 2017

From @AlexDaniel

Code​:
([+] **)(4, 8, 15).say

Result​:
Cannot resolve caller Numeric(HyperWhatever​: ); none of these signatures match​:
  (Mu​:U \v​: *%_)
  in block <unit> at -e line 1

I guess it is supposed to work?

@p6rt
Copy link
Author

p6rt commented Jan 20, 2017

From @coke

On Thu, 19 Jan 2017 18​:10​:27 -0800, alex.jakimenko@​gmail.com wrote​:

I guess it is supposed to work?

Why?

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 20, 2017

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

@p6rt
Copy link
Author

p6rt commented Jan 20, 2017

From @AlexDaniel

Gut feeling.

On 2017-01-20 08​:17​:06, coke wrote​:

On Thu, 19 Jan 2017 18​:10​:27 -0800, alex.jakimenko@​gmail.com wrote​:

I guess it is supposed to work?

Why?

@p6rt
Copy link
Author

p6rt commented Jan 20, 2017

From @zoffixznet

On Thu, 19 Jan 2017 18​:10​:27 -0800, alex.jakimenko@​gmail.com wrote​:

I guess it is supposed to work?

Isn't this the case where HyperWhatever is used as a term by itself, so you're passing it itself to [+] metaop and doesn't curry and hence its complaining.

Same's with regular Whatever​:

<Zoffix> m​: dd ([+] *)(42)
<camelia> rakudo-moar f97d5c​: OUTPUT«Cannot resolve caller Numeric(Whatever​: ); none of these signatures match​:␤ (Mu​:U \v​: *%_)␤ in block <unit> at <tmp> line 1␤

Also, I believe HyperWhatever doesn't just slurp the args and sub them in its place, but rather performs the operation for each of them. It basically curries into `sub (*@​_) { map &c, @​_ }`, where &c is he "curry"​:
<Zoffix> m​: dd (**.&[+](1))(4, 8, 15
<camelia> rakudo-moar f97d5c​: OUTPUT«(5, 9, 16).Seq␤»

So even if it curried in the OP example, it'd just return the same seq back, since the [+] would be called with 1 arg each time.

@p6rt
Copy link
Author

p6rt commented Jan 20, 2017

From @AlexDaniel

This makes sense.

On 2017-01-20 09​:54​:37, cpan@​zoffix.com wrote​:

On Thu, 19 Jan 2017 18​:10​:27 -0800, alex.jakimenko@​gmail.com wrote​:

I guess it is supposed to work?

Isn't this the case where HyperWhatever is used as a term by itself,
so you're passing it itself to [+] metaop and doesn't curry and hence
its complaining.

Same's with regular Whatever​:

<Zoffix> m​: dd ([+] *)(42)
<camelia> rakudo-moar f97d5c​: OUTPUT«Cannot resolve caller
Numeric(Whatever​: ); none of these signatures match​:␤ (Mu​:U \v​:
*%_)␤ in block <unit> at <tmp> line 1␤

Also, I believe HyperWhatever doesn't just slurp the args and sub them
in its place, but rather performs the operation for each of them. It
basically curries into `sub (*@​_) { map &c, @​_ }`, where &c is he
"curry"​:
<Zoffix> m​: dd (**.&[+](1))(4, 8, 15
<camelia> rakudo-moar f97d5c​: OUTPUT«(5, 9, 16).Seq␤»

So even if it curried in the OP example, it'd just return the same seq
back, since the [+] would be called with 1 arg each time.

@p6rt
Copy link
Author

p6rt commented Jan 23, 2017

From @moritz

Whatever and HyperWhatever doesn't behave magically inside of an argument list, so I see no bug here.

@p6rt
Copy link
Author

p6rt commented Jan 23, 2017

@moritz - Status changed from 'open' to 'rejected'

@p6rt p6rt closed this as completed Jan 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant