-
Notifications
You must be signed in to change notification settings - Fork 9
Enable expressions in lists #537
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
Conversation
Hi @NicoLaval, can you distinguish between "lists" and "listsComponent"? Also I think we must change the documentation in order to clarify:
This is to make sure that we can determine valuedomain errors at the semantic validation step. |
Hi @vpinna80, G4 is updated, with 2 branches, one for scalars and one for components. I also updated the name Regarding the docs, please provide your updates. Shouldn't we also add examples with components? |
I do not understand the use of listComponent, I believe the original proposal was fine if there are no ambiguities |
Maybe @vpinna80 wants to be able to write something like:
|
Which on the other hand no longer allows us to compare a component one to constant scalars. |
Yes, only variables which are components can be used inside the square brackets, no other. @NicoLaval Regarding the docs, i cannot update your pull request, but you should be able to edit the doc file directly on GitHub: |
Just to clarify, I understand by your suggestion the in operator will use therefore:
Seeing both use cases, it still makes no sense to have both list and listComponent. I believe it goes out of scope of the issue anyway to add the compatibility of component names inside the in operator |
I think adding listComponent is the only way to ensure that expr and exprComp are similar. Why dont you think it make sense @javihern98 ? |
Well the use of this token will we the same and have the same syntax whether we use it inside a calc or not, and we cannot use this token outside of the in operator. So to separate them in list and listComponent I find it redundant |
Why do you think external variables should no be possible? In any case, i think this can easily be a runtime check, not a grammar check. |
Ah, I see. I think this boils down to the duplicated expr branches then. I think we touched upon the subject in Salamanca. The whole exprComp rule branch only exists to account for a few disparities that only apply to components. I don't remember what they were but this really be fixed. @NicoLaval didn't we create an issue about this? We ended up patching the grammar in trevas to only have one expr rule. |
Hi @hadrienk, @javihern98, Beyond producing a tree twice as big, this does not allow mixing the types (I will do a PR for the Levenshtein distance during the day, I will have the same problem). In this context, for instance, consider:
With
To produce
This is not valid while we keep this However, it seems to me that defining this script makes sense. |
Why is it not valid? I tested it with the change and it parses correctly.
|
Syntactic validation is good, but if you resolve expr and exprComponent differently in your engine, it will bug. And, if it doesn't bug, it's because you infer the types at runtime, and in this case, why keep the 2 branches? |
@linardian , why closed & deleted? |
I fixed the error in 2.1.
Since the Levenshtein operator was not defined according to the agreed syntax, to avoid confusion I dropped the whole changes.
If you do not agree please let me know how to proceed
Best
Angelo.
|
Hi Angelo, Just by restoring the branch, and let the discussion and code adjustments take place. Thanks |
Hi Angelo. Until a branch is "merged" it has no impact with the current version so there's no need to close/delete them. |
Yes, you are right. But since we have just finished to build the baseline for 2.2, so I preferred to avoid any possible error. |
Fix #506