3 ms·
Well, my initial claim was that Lisp needs macros in a way that C/C++ doesn't. You are now stating that Lisp could have been written in a way that it didn't ne
by AnimalMuppet 13y ago
Well, my initial claim was that Lisp needs macros in a way that C/C++ doesn't. You are now stating that Lisp could have been written in a way that it didn't need macros to be usable. And you're right, it could have been. But I don't think that that's the point.
The point is not that implementing things as macros is a weakness. It's that the language (as written) needs those macros. And C, as written, does not.
But I suppose from your point of view, my argument is a distinction without a difference...
- gjm11 13y agoWell, yes, it is. You can turn Common Lisp (as it is) into a "language that doesn't need those macros" simply by going through the spec and changing everything that says, e.g., "macro DEFUN" to "special form DEFUN". The result would be a language that's no more powerful, no easier to implement, and marginally less convenient to use. So how can "needing those macros" be a weakness, if the minimal change that makes the language not "need those weakness" improves nothing and actually makes the language a little worse?
- jecxjo 13y agoI understand what you are saying. Its more of a claim that C/C++ does not need this project, as macros are not a necessity of the language. I think the one thing that this project could provide (though due to the lack of function call access inside of macros that IS provided in Lisp macros maybe not) is to take that 10% of functionality that C/C++ does not provide and make it much more easily accessible. Of course this is always the difficult situation to discuss when first learning about Lisp macros because so much "standard" functionality already exists but I assume the old trusty could be applied here. In many tutorials for learning Lisp macros the idea of "Lets say you wanted a statement (when <test> <expression>)." Its something that doesn't exist and the developer can add it in during development. You do not have to wait for someone else to implement this into your compiler. This is a case where Lisp _needs_ macros to implement and where C/C++...can't do anything. Yes you can make a function that is similar to the format required but that is kind of the point. Its a hack to get the functionality and not something that looks natural.
- AnimalMuppet 13y agoI agree, there's that 10% in C/C++. And, you're stuck. But working around that 10% is an annoyance, not crippling. (In over 20 years as a professional C/C++ developer, I have never hit something that I couldn't write. "when <test> <expression>", for example. Yes, I can't write that exact syntax, but I don't care. I can get the same result, though perhaps slightly more clumsily.) But Lisp without macros is crippled. But, as lispm and gjm11 pointed out, Lisp could have been implemented with those macros as special forms instead, so Lisp wouldn't have to be crippled without macros. My main point: I think the Lisp crowd overestimates how limiting it is for other languages not to have macros.