Skip to content

Commit

Permalink
Merge pull request #2587 from Michael-S/master
Browse files Browse the repository at this point in the history
Add section on exporting multi methods in a Module
  • Loading branch information
JJ committed Jan 24, 2019
2 parents 1de4ab9 + 986a9c6 commit c104c8c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions doc/Language/modules.pod6
Expand Up @@ -263,6 +263,17 @@ authors and versions).
constant FOO is export = "foobar";
enum FooBar is export <one two three>;
# for multi methods, if you declare a proto you
# only need to mark the proto with is export
proto sub quux(Str $x, |) is export { * };
multi sub quux(Str $x) { ... };
multi sub quux(Str $x, $y) { ... };
# for multi methods, you only need to mark one with is export
# but the code is most consistent if all are marked
multi sub quux(Str $x) is export { ... };
multi sub quux(Str $x, $y) is export { ... };
# Packages like classes can be exported too
class MyClass is export {};
Expand Down

0 comments on commit c104c8c

Please sign in to comment.