Hacker News new | past | comments | ask | show | jobs | submit login

Lisps do that distinction because they need it. In R, you can do everything with functions, because arguments can be lazily evaluated, or you can even get the syntax tree used for that argument at call site instead. So in R, a macro is just a function.

And yes, it's easy to break stuff that way. Just as easy as it is with macros (esp. non-hygienic ones).




> Lisps do that distinction because they need it.

Because of much better performance and predictability of code.

See: http://www.nhplace.com/kent/Papers/Special-Forms.html


I'm not saying it's a better way to do things. It trades having fewer primitives (and hence simpler language structure) for performance. But the use of lazy evaluation is pervasive in R in general, so it's a conscious design decision that they made.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: