Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds sections on modules #353

Merged
merged 6 commits into from
Oct 17, 2024
Merged

Adds sections on modules #353

merged 6 commits into from
Oct 17, 2024

Conversation

popematt
Copy link
Contributor

Issue #, if available:

Description of changes:

Adds sections for modules in general and the various types of modules.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@popematt popematt requested a review from zslayton October 17, 2024 09:02
Copy link
Contributor

@zslayton zslayton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! All my comments are superficial.

_books/ion-1-1/src/modules.md Show resolved Hide resolved
_books/ion-1-1/src/modules.md Outdated Show resolved Hide resolved
_books/ion-1-1/src/modules.md Outdated Show resolved Hide resolved
_books/ion-1-1/src/modules.md Show resolved Hide resolved
_books/ion-1-1/src/modules.md Outdated Show resolved Hide resolved
_books/ion-1-1/src/modules/defining_modules.md Outdated Show resolved Hide resolved
_books/ion-1-1/src/modules/defining_modules.md Outdated Show resolved Hide resolved
_books/ion-1-1/src/modules/encoding_module.md Show resolved Hide resolved
_books/ion-1-1/src/modules/grammar.md Show resolved Hide resolved
_books/ion-1-1/src/modules/defining_modules.md Outdated Show resolved Hide resolved

### `macro_table`

Macros are declared after symbols.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason for this ordering? Food for thought: if symbols were declared after macros, would that make it clearer that the symbols defined in an encoding directive are not yet available for use in the macro definitions in that same encoding directive?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #356

Macro names are optional, and improve legibility when using, writing, and debugging macros.
When a name is used, it must be an identifier per Ion’s syntax for symbols.
Macro definitions being added to the macro table must have a unique name.
If a macro is added whose name conflicts with one already present in the table, the implementation must raise an error.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for the system macros, which may be shadowed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They can only be shadowed in the sense that a system macro make_string can exist in the system macro table at the same time as a user macro make_string can exist in any other macro table. However, it is never legal to have two macros given the same name in the same macro table, even if one is a system macro.

_books/ion-1-1/src/modules/encoding_module.md Show resolved Hide resolved
_books/ion-1-1/src/modules/inner_modules.md Outdated Show resolved Hide resolved
@popematt popematt merged commit 2dd57cc into amazon-ion:gh-pages Oct 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants