Uri Guttman asked:

how would you handle %EXPORT_TAGS and @EXPORT_OK?

Export-only-by-request (i.e. @EXPORT_OK) becomes the default.


The tag names become arguments to C<is export>:

sub foo is export(:BAR, :FOOLISH) {...} # Now in two named tagsets

Every exportable is automatically also in the :ALL tagset.


To export-by-default (i.e. the @EXPORT behaviour) you write:


sub foo is export(:DEFAULT) {...}

To export-in-all-cases (not currently possible) you write:

sub foo is export(:MANDATORY) {...}

See Perl6::Export for details and implementation (but bear in mind that those details are almost certain to change as a result of this very thread).

Damian


Reply via email to