We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
using
Right now, we have with which basically creates a new block by encapsulating a given variable/value (very useful in a "closure" context).
with
What using would do is something similar-ish, but:
this
Also, using as a name is used in very similar contexts in other languages... So...
In short: the idea is to... introduce a forced this (and restore the previous one, if there), so that we can use field \shortcuts. As similar idea is Nim's own with: https://nim-lang.org/docs/with.html#with.m%2Ctyped%2Cvarargs%5Buntyped%5D
\shortcuts
And, yes, it's more than just a simple coincidence... lol (👀 #1731)
Example:
; before window\size: [300, 400] window\center window\title: "New window" ; after using window [ \size: [300, 400] \center \title: "New window" ]
The text was updated successfully, but these errors were encountered:
What a great addition! This would improve the readability and workflow. ❤️
Sorry, something went wrong.
drkameleon
Successfully merging a pull request may close this issue.
Right now, we have
with
which basically creates a new block by encapsulating a given variable/value (very useful in a "closure" context).What
using
would do is something similar-ish, but:this
Also,
using
as a name is used in very similar contexts in other languages... So...In short: the idea is to... introduce a forced
this
(and restore the previous one, if there), so that we can use field\shortcuts
.As similar idea is Nim's own
with
: https://nim-lang.org/docs/with.html#with.m%2Ctyped%2Cvarargs%5Buntyped%5DAnd, yes, it's more than just a simple coincidence... lol (👀 #1731)
Example:
The text was updated successfully, but these errors were encountered: