-
Notifications
You must be signed in to change notification settings - Fork 22
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
Conversation
There was a problem hiding this 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.
Co-authored-by: Zack Slayton <[email protected]>
Co-authored-by: Zack Slayton <[email protected]>
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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
Issue #, if available:
None.
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.