-
Notifications
You must be signed in to change notification settings - Fork 2
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
Use '.@' at the end of the param, to pass effective path instead of the value #1
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e4d7154
Use '.@' at the end of the param, to pass effective path instead of t…
c440335
That was lame... :)
c248c85
That was also unnecessary in that test
1d1ee6c
Added 'functional style' for the param path fetching
810bd33
Revert "Added 'functional style' for the param path fetching"
983d8e7
able to fetch context from forx engine via params
d9d4bae
Codacy fix
d91a932
removing unused import in test
komlev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Yes, this is good, my only doubt is that we are taking another symbol "@" as operation. Intention is to make path as less DSL filled as possible. What do you think of another approach, where we can add current path as a parameter to a function here? Not just p() but p(contextPath)?
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.
Function as parameter will have something extra in terms of input data, it might be context path and value also
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 did it somewhat more as a "function as decorator" than "function as parameter".
This way we have someting that is looking as functional thing (and for simplicity i decided to go with the creating function that has a special "tag value" assigned as own key).
Other implementations I've done was based on the getPathTo returning object that had "original parameter" and flags (which was effectively pretty much the same as this implementation, but had more lines and ifs) and the "hoc style" that has created new function that was "identifying" itself when it received special argument (and that was too magical, and there was a chance of side effects if someone passed function as a param and if that function had side effects).
The most "stylish" would be probably based on class, then we could check if the object is instance of some our tool class, and then we could use that information to get the path instead of data, but that would then be biggest in the LOC sense, I think.
I agree, this is not ellegant to just "attach" own key to the function, but I think it's a) small, b) easy, c) fast.