Skip to content

Confusing wording in module system public/private summary bullet #422

@kazagistar

Description

@kazagistar

Problem

Chapter 07-00 has a number of bullet points which provide a summary for the module system, and point #2 seems ambiguous.

Full text:

By default, everything is set as private, but you can use the pub keyword to make the module public, and therefore visible outside of the namespace.

Intended interpretation:

Everything is private by default; module is part of everything; therefore module is private by default. Pub makes private things visible outside their module; a module is a private thing; therefore public can make a module visible.

I'm not sure if I am just slow, but it took me three or four readings to understand this, even knowing what the real behavior is. Instead, I had an interpretation that was more like this:

By default, everything in a module is set as private, but you can use the pub keyword to make the module public, and therefore make it and its contents visible outside of that module.

Suggestion

By default, the contents of a module (including nested modules) are private, but you can use the pub keyword to make them public, and therefore visible outside of that modules namespace.

... or something along those lines?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions