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
BEGIN GLOBAL::<name> assignment does not work in Rakudo #3531
Comments
From @masak<nine> m: BEGIN GLOBAL::<Test> = class { }; Test.new; |
From @AlexDanielAs of today (2017.11,HEAD(e5b660e)) it prints this: Cannot call method 'new' on a null object Which is arguably reasonable, but I guess it's not good enough. On 2014-09-24 04:03:12, masak wrote:
|
The RT System itself - Status changed from 'new' to 'open' |
From @lizmatIf you normally create a class, the entry in GLOBAL:: is decontainerized: $ 6 'class Test {}; use nqp; dd nqp::iscont(GLOBAL::<Test>)’ However, if you just assign to a key in GLOBAL::, the result *is* containerized: $ 6 'BEGIN GLOBAL::<Test> = class { }; use nqp; dd nqp::iscont(GLOBAL::<Test>)’ So maybe you should just bind to the key in GLOBAL:: ? $ 6 'BEGIN GLOBAL::<Test> := class { }; dd Test.new' Now, perhaps this can be fixed by having a nqp::decont() somewhere deep in the bowels for every reference to something in GLOBAL:: . But I fear that, even if it only a little bit of overhead, it’s overhead we don’t need. An alternate option would be to create a Stash.ASSIGN-KEY that would not create a container, but instead would bind. But that also feels a bit too magical to me. So I think we should mark this ticket as “DIHWIDT”, and point to the workaround of binding.
|
Migrated from rt.perl.org#122838 (status was 'open')
Searchable as RT122838$
The text was updated successfully, but these errors were encountered: