3 ms·
As a Clojure fan, while I appreciate the author's effort, and admit I would do a much worse job, I'm bothered by oversimplifications like these: - "Like all Li
by mattfenwick 13y ago
As a Clojure fan, while I appreciate the author's effort, and admit I would do a much worse job, I'm bothered by oversimplifications like these:
- "Like all Lisps, it employs a uniform structure"
- "All Clojure code is written in a uniform structure"
- "Forms have a uniform structure."
- "In other languages, different operations might have different structures depending on the operator and the operands."
- "No matter what operator you're using or what kind of data you're operating on, the structure is the same."
It's pretty obvious that forms don't have a uniform structure (e.g. the structure of a number is pretty different from the structure of a vector), and that the structure depends on the operator (e.g. `def` special form vs. `or` macro).
Yes, Clojure syntax is relatively simple, no need to oversell it.
Still, that's a minor issue that doesn't detract from the overall quality and usefulness of the work.
- nonrecursive 13y agoThanks for the feedback, I've been finding it tricky to get the explanation right here. I don't have much time now and I'll try to reply with more later, but macros, special forms, and functions do indeed all have the same structure of opening parenthesis, operator, operands, closing parenthesis.
- nonrecursive 13y agoOne of the ideas I'm trying to convey is that the structure of the code is different from the syntax. With Clojure, special forms like def, if, etc, provide syntax in that each one has different rules for how their arguments get evaluated or, in the case of def, how the environment is changed. On top of that, you have macros which allow you to introduce arbitrary syntax. However, all Clojure code does have the same uniform structure. It's all composed of s-expressions, which are either atoms or other s-expressions enclosed in parentheses (for lists), braces (for maps), or brackets (for vectors). Thanks again for this feedback, having to explain this has given me some ideas for how to improve the chapter :)