Re:Feature Macros, an Alternative to Feature Expressions in ...
by mklappstuhl on Wednesday January 21, 2015 @10:37AM
(#8923499)
Does this also affect the #_ discard macro? And what about anonymous functions like `#(+ 5 %)`? Since those are reader macros I assume yes?
[ Parent
| on HN ]
Re:Feature Macros, an Alternative to Feature Expressions in ...
by michaniskin on Wednesday January 21, 2015 @10:43AM
(#8923533)
The Feature Macros proposal is only adding macros and vars to Clojure---the reader isn't modified at all. Since all of the things you mentioned are reader macros (as you pointed out), Feature Macros never even see them, so they won't be affected in any way. (Reader macros are expanded before regular macros are, so regular macros don't see things like `#(...)`, they see `(fn [] ...)`.)
Re:Feature Macros, an Alternative to Feature Expressions in ...
by _halgari on Wednesday January 21, 2015 @11:10AM
(#8923683)
The great point made in the README is that we can't generate feature expressions. With feature macros we can have macros that generate cross-platform code. That's big in my mind.
That hasn't been a problem with reader macros in the past since you don't need to generate `#(...)` if you have `(fn [] ...)`.
Re:Feature Macros, an Alternative to Feature Expressions in ...
by brandonbloom on Wednesday January 21, 2015 @12:37PM
(#8924249)
See my comment here: https://news.ycombinator.com/item?id=8924227
I don't understand when I would ever want to generate a feature expression. The goal is to generate platform-specialized code. You never have to generate code that generates platform-specialized code!