-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
[FEATURE] Let-in syntax in simplexpr #408
Comments
The
Example:
That implementation can be found here: MartinJM@a4e2095 I do have a question about the let-in syntax: What would the scope of the variable be? The first expression after the If I may also add my own opinions: If (Simplexpr) variables are not supported in local variables, I think it would make sense to have a different syntax. If the syntax is the same, I think it will lead people to believe that the functionality is the same as well. I'm personally also not really a fan of newline-based stuff. But besides that, I think that newlines in a Simplexpr aren't really supported at the moment? At least, I haven't found a way to have them in a Simplexpr. |
Would it make sense to instead follow what ml does here with
|
Is the
|
I would say that while For instance, how would you go about telling a new user that while this is allowed
this is not
you would probably get some "not in definition scope" error at line 4, but it would be unclear why (especially if a user hasn't used this specific functional construct before).
|
Description of the requested feature
The more complexity simplexpr allows for, the more use there would be for variables within expressions.
Given #324, it might make sense to try and come up with some unified syntax or principle for this, although having separate syntax in simplexpr might not be an issue, either.
Alternatively, it could be stated that it'd make sense to just rely on the local variables requested in #324, and have separate expressions.
However, I could still see having let-in syntax for simplexpr explicitly be a worthwhile addition.
Proposed configuration syntax
(not sure about newline sensitive stuff here, not really a fan :/
Additional context
One alternative to this has been proposed with the
with
function in #407The text was updated successfully, but these errors were encountered: