3 ms·
> You have the Common Lisp approach, where you work in a complicated sublanguage like this example from PCL: I don't think you actually understand anything abo
by sedachv 9y ago
> You have the Common Lisp approach, where you work in a complicated sublanguage like this example from PCL:
I don't think you actually understand anything about the example code you posted. There is no special "complicated sublanguage" - the backquote[1] is an extension of the quote shorthand notation[2] for list literals. It is for building data structures and has nothing to do with "sublanguages" or macros. There is no special syntax for macros in Common Lisp. Common Lisp macros do not produce source code - they produce any type of Common Lisp objects directly. That is why they are simpler and strictly more powerful than D templates.
When it comes to templates, I wouldn't call anything from this list of D examples[3] elegant.
[1] http://www.lispworks.com/documentation/HyperSpec/Body/02_df.htm http://www.lispworks.com/documentation/HyperSpec/Body/02_df....
[2] http://www.lispworks.com/documentation/HyperSpec/Body/s_quote.htm http://www.lispworks.com/documentation/HyperSpec/Body/s_quot...
[3] https://dlang.org/templates-revisited.html https://dlang.org/templates-revisited.html
- bachmeier 9y ago> I don't think you actually understand anything about the example code you posted. This doesn't add anything to the conversation. If you want to discuss my post, I'm happy to discuss. You're clearly upset that I didn't praise Common Lisp, but things like that don't lead to useful discussion. > There is no special "complicated sublanguage" - the backquote[1] is an extension of the quote shorthand notation[2] for list literals. It is for building data structures and has nothing to do with "sublanguages" or macros. There is no special syntax for macros in Common Lisp. I've never seen anyone write macros using only s-expressions. True, you don't need to learn any special syntax to do it, but that's not how anyone writes macros. > When it comes to templates, I wouldn't call anything from this list of D examples[3] elegant. How is that is relevant to my comment?
- sedachv 9y ago> You're clearly upset that I didn't praise Common Lisp, but things like that don't lead to useful discussion. > How is that is relevant to my comment? No, I am upset that you are posting misinformed comments about Common Lisp macros vs D templating while representing yourself as being knowledgeable about the subject. You clearly do not understand how the former works. > I've never seen anyone write macros using only s-expressions. True, you don't need to learn any special syntax to do it, but that's not how anyone writes macros. Please stop pretending that you have enough experience with Common Lisp to say things like "I've never seen anyone do X." Writing macros that call functions that return code is a basic technique - Graham's On Lisp is full of examples. Saying that quoting as a way of specifying list literals is a "complicated sublanguage" is on the level of "C++ templates have too many pointy brackets" of criticism.