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

Updates system macro descriptions #368

Merged
merged 4 commits into from
Nov 25, 2024
Merged

Conversation

popematt
Copy link
Contributor

Issue #, if available:

None.

Description of changes:

  • Adds links to conformance tests
  • Updates signatures of system macros and adds further description in some cases where more description is necessary to explain restrictions that are not able to be conveyed in the macro signature.

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

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.

Couple of small things to look at before merging.

_books/ion-1-1/src/macros/system_macros.md Outdated Show resolved Hide resolved
_books/ion-1-1/src/macros/system_macros.md Outdated Show resolved Hide resolved
popematt and others added 2 commits November 22, 2024 13:52
Co-authored-by: Zack Slayton <[email protected]>
Co-authored-by: Zack Slayton <[email protected]>
Comment on lines 281 to 292
Produces a non-null, unannotated timestamp at various levels of precision.
When `offset` is absent, the result has unknown local offset; offset `0` denotes UTC.

The arguments to this macro may not be any null value.
The evaluated argument for the `second` parameter, if present, must be a decimal or integer value that is greater than
or equal to zero and less than 60. The evaluated arguments for all other parameters, if present, must be integer values.

The `make_timestamp` macro has additional rules (that cannot be expressed in the macro signature) because it must
construct a valid Ion timestamp value.
The `offset_minutes` and `hour` parameters may only be present if `minute` is present. Aside from `offset_minutes`, if
any evaluated argument is present, the evaluated arguments for all parameters to the left must also be present.
The precision of the constructed timestamp is determined by which parameters have non-empty arguments.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why specify the range constraints for second but not for day, month, or hour?
Secondly, could one not default unspecified parameters to 0? Or should that be left up to the user to define such macros if they are useful?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why specify the range constraints for second but not for day, month, or hour?

I'll update the description.

Secondly, could one not default unspecified parameters to 0?

Well, that already happens (somewhat) because of timestamp semantics. E.g. these macro invocations all represent the same point in time, but with different precisions.

(:make_timestamp 2024 12) 
(:make_timestamp 2024 12 1) 
(:make_timestamp 2024 12 1 0 0) 
(:make_timestamp 2024 12 1 0 0 0) 
(:make_timestamp 2024 12 1 0 0 0.000) 

@popematt popematt merged commit d6fb7b6 into amazon-ion:gh-pages Nov 25, 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.

4 participants