5 ms·
"macros that are so powerful" You just made every single Common Lisp programmer who reads your comment cringe. Clojure is a very nice language and while it ha
by klibertp 12y ago
"macros that are so powerful"
You just made every single Common Lisp programmer who reads your comment cringe.
Clojure is a very nice language and while it has no real innovations it does bundle a few unusual (for mainstream) concepts into a single easy to use package. However, you should wait with calling Clojure macros "powerful" until after you get access to readtable. Or wait, you won't ever, that's a feature, supposedly...
- nickik 12y agoJust because its not the most powerful macro systen ever created does not mean that its not powerful, so the sentence is completly ok.
- weavie 12y agoIt is definitely more powerful than Javascripts...
- klibertp 12y agoYou mean it's better than Sweet.js? http://sweetjs.org/ http://sweetjs.org/
- weavie 12y agoNo, I haven't looked into sweetjs enough. I was just referring to raw javascript macros.. (ie. non existent).
- klibertp 12y agoRight, in general languages without any means of syntactic abstraction feel contrived to me now, and after working with several macro-enabled languages I really want to have support for them in more places. JS (Sweet.js), along with Dylan and Nimrod (and others) showed that it's possible to have real macros in non-prefix languages - I wonder how long it will take the "mainstream" to become comfortable with this feature. It looks like it takes anywhere between 20 to 40 years on average for concepts to "enter mainstream", so I think we're going to have to wait quite a long time yet.
- nickik 12y agoYou might want to check out the PLOT langauges, its just a spec but a great read if you are into macros.
- deleted 12y ago[deleted]
- nickik 12y ago> Sweet.js brings the hygienic macros of languages like Scheme and Rust So it seams to clojure macro system is more powerful. That said that does not mean its better.
- klibertp 12y agoOf course, Sweet.js provides means for breaking hygiene. Also, Clojure macros are kind-of, a-little-bit hygienic, with their rules for identifiers resolution. Anyway, I'd say they're rather similar in expressivity and capabilities, but I don't know both macro systems well enough to do detailed comparison.
- kul_ 12y agoyou can break hygiene in clojure macros using classical anaphoric macros. I guess that holds for clourescript as well.
- divs1210 12y agoClojure has something better than CL reader-macros [1]. These are name-space specific, and more composable than CL's reader macros. And reader-macros can be achieved with a small hack [2]. [1] http://www.infoq.com/interviews/hickey-clojure-reader http://www.infoq.com/interviews/hickey-clojure-reader [2] http://briancarper.net/blog/449/clojure-reader-macros http://briancarper.net/blog/449/clojure-reader-macros
- lispm 12y agoThat's a just small part of Lisp's reader macros.