We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Migrated from rt.perl.org#115132 (status was 'resolved')
Searchable as RT115132$
The text was updated successfully, but these errors were encountered:
Hi,
My version of rakudo: This is perl6 version 2012.09.1-7-gfb11f13 built on parrot 4.8.0 revision RELEASE_4_8_0
I was trying to use an environment variable to assign a boolean to a constant:
BEGIN { %*ENV<FOO> //= "bar" } constant FOO_IS_BAR = %*ENV<FOO> ~~ "bar" | "Bar";
I got the following error: ===SORRY!=== Cannot assign to a non-container
shell returned 1
The error can be reproduced quicker this way (but it has less meaning):
constant x = "foo" ~~ /bar/;
The same line does not produce any error with niecza.
Regards
Sorry, something went wrong.
this works now (probably for a while, already). I added a test to S04-declarations/constant.t with the following commit: Raku/roast@6cc8c38a1c
Please note: If you smart match agains a regex you don't get a boolean value but either a Match object or Nil:
("foo" ~~ /foo/).WHAT.say (Match) ("foo" ~~ /bar/).WHAT.say Nil
As per S03 you can use "so" to force a Bool value:
("foo" ~~ /foo/).so True ("foo" ~~ /bar/).so False
But that's only a minor point, the assignment to a constant works for all versions.
The RT System itself - Status changed from 'new' to 'open'
@usev6 - Status changed from 'open' to 'resolved'
No branches or pull requests
Migrated from rt.perl.org#115132 (status was 'resolved')
Searchable as RT115132$
The text was updated successfully, but these errors were encountered: