4 ms·
I've had to deal with code like that, only poorly mimicking Lisp instead: `#define unless(_x) if (!(_x))` etc... One of my favourite accidental features in Rus
by simias 6y ago
I've had to deal with code like that, only poorly mimicking Lisp instead: `#define unless(_x) if (!(_x))` etc...
One of my favourite accidental features in Rust is that macros are so annoying and cryptic to write that people think twice before abusing them.
- Gene_Parmesan 6y agoWouldn't be surprised if that was intentional, actually. The idea of making syntax a little unwieldy for things that you should really think twice before using is not a new one.
- TeMPOraL 6y agoI understand the temptation. I keep catching myself on writing `unless( ... )` in C++ every couple days, and I've considered adding a macro for it, but ultimately decided against it, as the rest of the team would not understand why I need it.