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

'self()' is parsed as a call to the term 'self', not to a function &self, in Rakudo #1433

Closed
p6rt opened this issue Dec 11, 2009 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 11, 2009

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

Searchable as RT71194$

@p6rt
Copy link
Author

p6rt commented Dec 11, 2009

From @masak

<masak> rakudo​: sub self() { say "OH HAI" }; self
<p6eval> rakudo 7ef386​: Lexical 'self' not found [...]
* masak submits rakudobug
<moritz_> nope, that's fine
<moritz_> rakudo​: sub self() { say "OH HAI" }; self()
<p6eval> rakudo 7ef386​: Lexical 'self' not found [...]
<moritz_> *that's* a bug
<masak> ah. :)
<masak> rakudo​: sub self() { say "OH HAI" }; &self()
<p6eval> rakudo 7ef386​: OH HAI␤
<moritz_> but without the parenthesis the built-in takes precedence,
if it's parsed as term (and not as function)
<moritz_> std​: self ~~ 1
<p6eval> std : ok 00​:01 106m␤
<moritz_> std​: sub a { }; a ~~ 1
<p6eval> std : �[31m===�[0mSORRY!�[31m===�[0m␤Preceding context
expects a term, but found infix ~~ instead [...]
<moritz_> and you see that STD.pm doesn't parse self as a function
<masak> right. it's a term.

@p6rt
Copy link
Author

p6rt commented Mar 11, 2010

From @moritz

works now, and tested in S02-names_and_variables/names.t (lacking a
better idea on where to put such tests).

@p6rt
Copy link
Author

p6rt commented Mar 11, 2010

@moritz - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Mar 11, 2010
@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