develooper Front page | perl.perl6.users | Postings from January 2017

Re: Re-export symbols

Thread Previous | Thread Next
Lloyd Fournier
January 10, 2017 19:25
Re: Re-export symbols
Message ID:
Hey Fernando,

This is not yet implemented in rakudo. I included a way of doing this in
CompUnit::Util <>. I'm
not sure when/if :EXPORT will be implemented (I actually don't think it's a
good idea).

I've just realised that there is another solution though. You can do this:

use FirstModule;
my package EXPORT::DEFAULT { } # initialise the export namespace
BEGIN for <&foo &bar &baz> { # iterate over the things you want to
re-export by default
        EXPORT::DEFAULT::{$_} = ::($_)

This actually might be worth adding to the docs.


On Sat, Dec 31, 2016 at 8:43 AM Fernando Santagata <> wrote:

> Hello,
> I have a module that defines some constants and another one that use the
> first module.
> I wish to re-export those constants.
> I read here:
> that this:
> use FirstModule :EXPORT;
> should re-export the imported symbols, but it throws an error (no such tag
> 'EXPORT').
> Any idea?
> --
> Fernando Santagata

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About