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 call a routine using 'foo' syntax when a module 'foo' is declared in Rakudo #2962
Comments
From @masak<diakopter> r: module foo; macro foo() { }; foo; foo(); # foo works; |
From @masak<jnthn> module foo; sub foo() { say "OH HAI" }; foo; foo() |
@masak - Status changed from 'new' to 'open' |
From @usev6There are no error messages anymore: $ perl6 -e 'module foo; macro foo() { }; foo; foo();' $ perl6 -e 'module foo; sub foo() { say "OH HAI" }; foo; foo()' As I understand it, both 'foo' and 'foo()' are invoking the class. (It is possible to call the sub with '&foo()', though.) $ perl6 -e 'module foo; sub foo() { say "OH HAI" }; say foo; say foo()' In the light of jnthn's comments, this looks right to me. So, is this closable with tests or did I misunderstand? |
1 similar comment
From @usev6There are no error messages anymore: $ perl6 -e 'module foo; macro foo() { }; foo; foo();' $ perl6 -e 'module foo; sub foo() { say "OH HAI" }; foo; foo()' As I understand it, both 'foo' and 'foo()' are invoking the class. (It is possible to call the sub with '&foo()', though.) $ perl6 -e 'module foo; sub foo() { say "OH HAI" }; say foo; say foo()' In the light of jnthn's comments, this looks right to me. So, is this closable with tests or did I misunderstand? |
From @skidsI was looking into making some worries about failing to shadow Turns out it is not, as far as I can see, and so we have this: (07:08:46 PM) skids: m: sub a (\b) { EVAL "sub b() \{ 42.say }; b().say;" }; a(2); a(Str) # found while tryng to make worries for RT#115608 ...which might be a bit more of an interpreterish semantic than we want? |
From @jnthnOn Mon Nov 05 09:39:33 2012, masak wrote:
It's ruled that forming a coercion type is the correct behavior: http://irclog.perlgeek.de/perl6/2015-11-26#i_11605891 And current Rakudo does indeed form one. Tests covering this behavior in S02-names-vars/names.t. |
@jnthn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#115608 (status was 'resolved')
Searchable as RT115608$
The text was updated successfully, but these errors were encountered: