10 ms·
> The `with` syntax is new to me, but it looks useful for dealing with lots of subfields. It's not syntax, but rather a third-party macro[0], which it should b
by masklinn 6y ago
> The `with` syntax is new to me, but it looks useful for dealing with lots of subfields.
It's not syntax, but rather a third-party macro[0], which it should be noted is inspired by a rather horrible feature of the same name in javascript. Though I guess the devil would be in the details.
[0] https://github.com/zevv/with https://github.com/zevv/with
- zevv 6y agoAnd I'm not even ashamed!
- elcritch 6y agoThanks @masklin for pointing that out -- sloppy language on my side, but I also didn't realize it was a third party library. Thanks @zevv for the macro!
- akavel 6y agoThere's also stdlib's with (https://nim-lang.org/docs/with.html https://nim-lang.org/docs/with.html), though for some reasons I'm not aware of it doesn't seem listed in the stdlib's ToC :/