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

Cannot pass a Method object to .^can #5047

Closed
p6rt opened this issue Jan 14, 2016 · 5 comments
Closed

Cannot pass a Method object to .^can #5047

p6rt opened this issue Jan 14, 2016 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Jan 14, 2016

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

Searchable as RT127263$

@p6rt
Copy link
Author

p6rt commented Jan 14, 2016

From @autarch

If I do a get errors like​:

Method object coerced to string (please use .gist or .perl to do that) in any can at gen/moar/m-Metamodel.nqp line 1109
Method object coerced to string (please use .gist or .perl to do that) in any can at gen/moar/m-Metamodel.nqp line 1114
Method object coerced to string (please use .gist or .perl to do that) in any can at gen/moar/m-Metamodel.nqp line 1115
Method object coerced to string (please use .gist or .perl to do that) in any can at gen/moar/m-Metamodel.nqp line 1114
Method object coerced to string (please use .gist or .perl to do that) in any can at gen/moar/m-Metamodel.nqp line 1115
Method object coerced to string (please use .gist or .perl to do that) in any can at gen/moar/m-Metamodel.nqp line 1114
Method object coerced to string (please use .gist or .perl to do that) in any can at gen/moar/m-Metamodel.nqp line 1114

I find it a bit surprising that this doesn't work. I'm not sure if this is intentional or not.

@p6rt
Copy link
Author

p6rt commented Jan 14, 2016

From @moritz

Hi Dave,

On 01/14/2016 07​:47 AM, Dave Rolsky (via RT) wrote​:

# New Ticket Created by Dave Rolsky
# Please include the string​: [perl #​127263]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=127263 >

If I do a get errors like​:

Method object coerced to string (please use .gist or .perl to do that) in any can at gen/moar/m-Metamodel.nqp line 1109
Method object coerced to string (please use .gist or .perl to do that) in any can at gen/moar/m-Metamodel.nqp line 1114
Method object coerced to string (please use .gist or .perl to do that) in any can at gen/moar/m-Metamodel.nqp line 1115
Method object coerced to string (please use .gist or .perl to do that) in any can at gen/moar/m-Metamodel.nqp line 1114
Method object coerced to string (please use .gist or .perl to do that) in any can at gen/moar/m-Metamodel.nqp line 1115
Method object coerced to string (please use .gist or .perl to do that) in any can at gen/moar/m-Metamodel.nqp line 1114
Method object coerced to string (please use .gist or .perl to do that) in any can at gen/moar/m-Metamodel.nqp line 1114

I find it a bit surprising that this doesn't work. I'm not sure if this is intentional or not.

The documentation at
https://doc.perl6.org/routine/can calls the parameter $method-name and
talks about method names, not Method object. Why does it surprise you
that you when you pass in something that's not a method name, you get
weird behavior?

Please also read the disclaimers at
https://doc.perl6.org/language/mop#Power%2C_Convenience_and_Pitfalls

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Jan 14, 2016

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

@p6rt
Copy link
Author

p6rt commented Jan 14, 2016

From @autarch

I just expect perl (5 or 6) to DWIM. I'll mark this ticket rejected.

@p6rt p6rt closed this as completed Jan 14, 2016
@p6rt
Copy link
Author

p6rt commented Jan 14, 2016

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

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