develooper Front page | perl.perl6.users | Postings from September 2018

Package Compile Question

Thread Next
From:
Richard Hogaboom
Date:
September 30, 2018 12:27
Subject:
Package Compile Question
Message ID:
13f34eb9-5ab4-6ec1-f8c9-ca87e1d1dc64@gmail.com
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>;  # nope - won't compile

# ===SORRY!=== Error while compiling 
/home/hogaboom/hogaboom/Perl6/p6ex/./p6test.p6
# Combination of indirect name lookup and call not supported
# at /home/hogaboom/hogaboom/Perl6/p6ex/./p6test.p6:16
# ------> say Foo::($bar)::⏏<$quux>;  # nope
#     expecting any of:
#         argument list

# See https://docs.perl6.org/language/packages
# and look at the first two sections: 'Names' and 'Package-qualified names'

-- 

rahogaboom

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About