-
Notifications
You must be signed in to change notification settings - Fork 20
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
Return SELF by default when modified #202
Comments
I'm afraid it is breaking one basic principle in Pan: every statement returns a value and in a DML you return the value returned by the last statement executed. |
i should be a more clear: i would only modify the behaviour is the last statement was an assignment and if |
can we have a pan function |
But why would you even write the code in the OP? Much better to just write:
|
In most use cases, we return SELF independent of existence.. so would then end up doing |
@stdweird will try to implement it. if it is easy, will open a PR and rediscuss at next workshop . if complex, will close this issue |
will cause /a to be undef if SOMETHING is false, hence the extra acrobatics to check SELF and return SELF or null. |
(i'm clueless how hard this is to implement, but oh boy is this annoying behaviour)
Currently
gives
becuase the dml has missing
SELF
at the end.i would propose that when SELF is modified in a dml block, that by default SELF is returned at the end instead of last assigned value (or whatever the current default behaviour is).
i guess noone modifies SELF and then returns something else, at least not intentionally.
The text was updated successfully, but these errors were encountered: