-
Notifications
You must be signed in to change notification settings - Fork 19
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
Allow <let/>
in <constraint/>
without requiring a sibling constraint
#552
base: develop
Are you sure you want to change the base?
Conversation
<constraint/>
without requiring a sibling constraint<let/>
in <constraint/>
without requiring a sibling constraint
So I tested the XML Schema by using the merged metaschema module change in #542 (comment) (the source of the issue reported and this PR) with the current XSD file via GH URL in Before: After: I am not sure if we want to include and integrate formal testing into this PR or a related issues for such things moving forward. Let me know. |
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.
I talked to @david-waltermire for informal review and we need to park this pragmatic and low-effort approach (I can be honest about my work 😄) and discuss different approaches to allow interweaving let
s with all the constraint types of having them separate. This could and likely will have implications on backwards compatibility on whether we allow interleaving or keeping them separate.
I am going to work on some examples to move forward discussion in our Element/Gitter chat and in upcoming community discussions.
0299d0a
to
06403a8
Compare
Discussion of this today was postponed, see #548 (comment) for more info. Converting this to draft for now as final reviews are not happening until proper discussion and longer feedback window. |
06403a8
to
27c7a2b
Compare
@@ -200,7 +200,9 @@ A `let` statement has a REQUIRED `@var` flag, which defines the variable name. | |||
|
|||
A `let` statement has a REQUIRED `@expression` flag, which defines an [Metapath expression](/specification/syntax/metapath), whose result is used to define the variable's value in the evaluation context. | |||
|
|||
During constraint evaluation, each `let` statement MUST be evaluated in encounter order. If a previous variable is bound with the same name in the evaluation context, the new value MUST bound in a sub-context to avoid side effects. This sub-context MUST be made available to any constraints following the `let` statement declaration, and to any constraints defined on child nodes of the current context. | |||
During constraint evaluation, each `let` statement MUST be evaluated in encountered order. If a previous variable is bound with the same name in the evaluation context, the new value MUST bound in a sub-context to avoid side effects. This sub-context MUST be made available to any constraints following the `let` statement declaration, and to any constraints defined on child nodes of the current context. |
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.
I am not sure if this is blocking and/or material to this PR or not.
This is technically out of scope for #548, but given today's conversation, do want to address this concern within this PR and adjust given discussion and around processing order here and now as it has been decided with scope rebinding being disallowed or defer that? Note, the diff on this paragraph is the result of me correcting encounter
to encountered
to be more grammatical. I think this was the intent.
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.
Ouch, I had a comment here, somehow I dropped it.
Can we codify a rule that no two let
element siblings have the same name
?
Can we write a constraint for that?
@david-waltermire also grateful for your input here.
@wendellpiez - My understanding from the comment above stating that "we need to park this pragmatic and low-effort approach [...] and discuss different approaches to allow interweaving |
Since OSCAL does not currently use This being the case I think @aj-stein-nist and @david-waltermire might prefer to drive the issue for now (assuming they need it to move) - while in principle I'm amenable to accepting this PR as soon as they say it is done. |
Committer Notes
Closes #548.
All Submissions:
Changes to Core Features:
Have you written new tests for your core changes, as applicable? Not sure if that is in scope for work item, feedback requested from reviewers.Have you included examples of how to use your new feature(s)?Have you updated all website](https://pages.nist.gov/metaschema) and readme documentation affected by the changes you made? Changes to the website can be made in the website/content directory of your branch.N/A for this change