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
The Destructuring macros works great for variable decralations:
var [a,b] = someArray var {x,y} = someObject
It does this by doing the obvious thing, which is to store the array in a temporary variable first.
var _ref = someArray var a = _ref[0]; var b = _ref[1];
However, another great feature of destructuring is reassigning values that isn't supported by this macro as of now:
[a, b] = [b, a]
Now this should work basically the same way as everything else:
var _ref = [b, a] a = _ref[0]; b = _ref[1];
There may be a problem without a keyword, so it is possible to perhaps create an empty keyword that doesn't put var or let?
The text was updated successfully, but these errors were encountered:
my best take so far is this:
let d = macro { rule { $id:ident } => { $id } rule { $pattern:destructor = $rhs:expr ;... } => { var __ref = $rhs; destruct $pattern ; __ref } } export d;
Sorry, something went wrong.
No branches or pull requests
The Destructuring macros works great for variable decralations:
It does this by doing the obvious thing, which is to store the array in a temporary variable first.
However, another great feature of destructuring is reassigning values that isn't supported by this macro as of now:
Now this should work basically the same way as everything else:
There may be a problem without a keyword, so it is possible to perhaps create an empty keyword that doesn't put var or let?
The text was updated successfully, but these errors were encountered: