Re: Package Compile Question

2018-10-01 Thread Brad Gilbert
`Foo::Bar::<$quux>` is basically short for `::Foo::Bar::('$quux')` (except the former is looked up at compile time) So the way to do this is: my $bar = 'Bar'; ::Foo::( $bar ~ '::$quux' ) or ::Foo::($bar)::('$quux') Note that the leading `::` are necessary for dynamic lookups.

Re: Package Compile Question

2018-10-01 Thread JJ Merelo
El lun., 1 oct. 2018 a las 13:47, Richard Hogaboom (< richard.hogab...@gmail.com>) escribió: > Hmm... the ($bar) in Foo::($bar)::<$quux>; is an interpolation, but the > <$quux> is just another way of writing $Foo::($bar)::quux;, not an > interpolation, no? > > Right. It kinda is, but it should

Re: Package Compile Question

2018-10-01 Thread Richard Hogaboom
Hmm...  the ($bar) in Foo::($bar)::<$quux>; is an interpolation, but the <$quux> is just another way of writing $Foo::($bar)::quux;, not an interpolation, no? On 10/1/18 7:41 AM, JJ Merelo wrote: Thanks. I'll fix that. WRT the original post, it looks like it should work, but apparently

Re: Package Compile Question

2018-10-01 Thread JJ Merelo
Thanks. I'll fix that. WRT the original post, it looks like it should work, but apparently can't. The error should be selfexplanatory. Either you interpolate using :: or <>, but not both... JJ El lun., 1 oct. 2018 a las 13:38, Richard Hogaboom (< richard.hogab...@gmail.com>) escribió: > Not

Re: Package Compile Question

2018-10-01 Thread Richard Hogaboom
Not exactly, but close.  The following line is exactly from the doc.  It works.  It it works, then the offending(next line) line should work as well. my$bar='Bar'; say$Foo::($bar)::quux; # compound identifiers with interpolations; OUTPUT: «42␤» sayFoo::($bar)::<$quux>; # won't compile -

Re: Package Compile Question

2018-09-30 Thread JJ Merelo
Is that taken verbatim from the docs? I'll create an issue if that's the case. JJ

Package Compile Question

2018-09-30 Thread Richard Hogaboom
This does not compile; I think it should: use v6; class Foo {     class Bar {     our $quux = 42;     } } say $Foo::Bar::quux;  # works - 42 say Foo::Bar::<$quux>;  # works - 42 my $bar = 'Bar'; say $Foo::($bar)::quux;  # works - 42 # shouldn't this work too? say Foo::($bar)::<$quux>;  #