problem-solving icon indicating copy to clipboard operation
problem-solving copied to clipboard

There is no easy way to use an EXPORT sub to export a long named spaces class

Open FCO opened this issue 11 months ago • 5 comments

If I try to do something like:

my \bla = Metamodel::ClassHOW.new_type: :name<Bla::Ble::Bli::Blo::Blu>;
bla.^compose;

sub EXPORT(--> Map()) {
    "Bla::Ble::Bli::Blo::Blu" => bla
}

When I use that, it adds the whole name as a key on ::.keys, which doesn't work.

If I try something like:

module Bla::Ble::Bli::Blo {}
Bla::Ble::Bli::Blo::<Blu> := bla;

It tends to conflict with modules declared outside that file.

I belive it should be an easy way of doing that.

FCO avatar Feb 17 '25 21:02 FCO