4 ms·
"Macros: why they're evil"
- pg 19y agoThere are ways around the syntactic capture issue, but they're very rare. This is like saying there are ways to avoid an index going off the end of an array, but they're rare. You avoid it by checking the length of the array. Unintentional variable capture is simply a bug. The only reason it even seems to people that they need a "way around" it is that they don't really understand what macros do.
- akkartik 19y ago> Unintentional variable capture is simply a bug. That's a useful statement if you're discussing programming within a specific language, not so useful to argue the language is fine as it is. Funny you should mention array overflow; for years (we) C programmers insisted it was 'simply a bug'. Then again, lack of hygiene enables anaphora, but lack of bounds checking has no such redeeming qualities.
- gruseom 19y agoLisp has a bunch of functions that generate new symbols that are guaranteed never to have been seen before, but writing code that's completely safe, so that it never accidentally captures or shadows an existing variable is a very tricky skill. Nonsense. The "skill" consists of calling one function (not a "bunch" of functions). For me, the hardest part of learning how to write safe macros was trying to figure out why people kept saying it's so hard.
- Hexstream 19y agoLet's see, this guy doesn't use (and doesn't even look like he's aware of the existence of) backquote, and he thinks watching out for variable capture, multiple evaluation and other well-known hazards with well-known solutions is hard... Never criticize that which you don't even understand the basics of, I say.