-
-
Notifications
You must be signed in to change notification settings - Fork 414
Expand the key API to allow for nested keys #8243
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
base: dev/feature
Are you sure you want to change the base?
Conversation
APickledWalrus
left a comment
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.
seems ok overall just a couple thoughts
| * | ||
| * @return true if nested structures are supported, false otherwise | ||
| */ | ||
| default boolean acceptsNestedStructures() { |
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.
Does this need to be used in EffChange's key handling?
| * | ||
| * @return Whether this expression allows nested structures. | ||
| */ | ||
| default boolean allowNestedStructures() { |
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.
Should it be possible to disallow nested structures? This method changing state on the Expression is slightly odd to me, but not necessarily a major issue.
Problem
There are a few issues that this PR aims to address. Most notably, there is currently no straightforward way to pass entire list structures around. The other issues consist of a couple of minor bugs introduced by the previous PR.
foo(keyed {_list1::*}, keyed {_list2::*})wherelist1andlist2both contain values corresponding to the same key) would throw an exception.Solution
This PR introduces new method to get an expression's values recursively, along with a corresponding
recursiveexpression that makes use of that behavior. When combined with thekeyedexpression, it allows both keys and values to be returned recursively, allowing entire structures to passed around seamlessly between different contexts.Addressing the aforementioned issues:
Parameterclass that evaluates expressions with respect to the parameter's modifiers. This unfortunately makes Fix function parameters with default value as list causing error #8221 obsolete.Testing Completed
StructFunction.sk,ExprRecursive.skSupporting Information
Below is a complete example showing how various combinations behave:
Using functions:
Completes: #8220
Related: none