nimskull
nimskull copied to clipboard
do node consistency
do nodes are now consistently lambda expressions no matter if they have arguments or not. stmtLists are no longer lifted implicitly to lambda expressions
Summary
- do nodes without arguments are not implicitly converted to bare
stmtList
anymore. - bare
stmtList
is not lifted to a lambda expression anymore. - The behavior that got removed was a hack that cause more problems than it solved.
Details
It caused problems in my macro library, especially the implicit lifting of stmtList
to a λ expression is a liability that is really hard to work around. It is not a feature to be proud upon. It is a breaking change, especially cases when do
blocks need to be treated as bare stmtList
and not λ expressions.
This is a change I've made a long time ago on my own fork of Nim.
@haxscramper the code I broke is mostly code you wrote, so I would really like to hear your opinion about it.
Can you provide an example for the behavior change?
This video from racket conf offers a better solution for alternatives and handling multiple groups to be associated with a previous line: https://youtu.be/UUWYTW3Xck8
Preview:
foo(stuff):
| One statement
Still part of one statement
| Second statement, both one and two are arguments to foo
Without something as the above we can't move forward with this do change.
This has gone stale and the multiple statements via pipes is required first. It can be resurrected if and when needed.