Skip to content

What makes unit be too late? #501

@arkiuat

Description

@arkiuat
  • The docs state (and have stated for many years) that a unit declaration at the beginning of a file may be preceded only by comments and use statements.
  • However, any declaration of sub EXPORT must precede the unit declaration.
  • Neither requirement seems to be tested in any roast tests that I could find (but I'm still a novice at searching in the roast repo).

The blocked docs issue Raku/doc#2148 is over seven years old, and the problem it describes is still in the current docs.

The statement at issue in the docs is in https://docs.raku.org/language/syntax#package,_module,_class,_role,_and_grammar_declaration and is currently worded as:

you can declare a unit package at the start of the file (preceded only by comments or use statements),

The conflicting (assuming that unit packages can make use of sub EXPORT) statement is in https://docs.raku.org/language/modules#EXPORT :

Please note that EXPORT can't be declared inside a package because it is part of the compunit rather than the package.

This issue is a re-open of the closed rakudo issue rakudo/rakudo#2020 as a problem-solving issue, as suggested at the time that issue was closed.

Metadata

Metadata

Assignees

Labels

documentationBig changes related to official Raku documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions