Comment by dgb23
3 years ago
Macros are one thing that you easily get from that syntax. And I would argue that it's far less of a footgun than you make it out to be.
But really there are many things that aren't mentioned such as Editor/IDE tooling, in-editor REPL, evaluating expressions, debugging, structural editing, code navigation, formatting...
Your example is actually kind of misleading, because the second variation is much closer to how you write in a Lisp than the first.
It would really be something like:
```
(def inc-all (partial map inc))
```
It really makes no sense to use a Lisp in a non expression based manner. The syntax is inherently optimized for it.
> Your example is actually kind of misleading, because the second variation is much closer to how you write in a Lisp than the first.
That's the point, yes. See how maybe the syntax isn't the important thing here?
It's syntax that is optimized for expressions rather than statements. There are a lot of nice features falling out of that. In my opinion it makes little sense to misuse it in order to show its utility. It's a little bit like quoting someone out of context if that makes sense.
> It's syntax that is optimized for expressions rather than statements.
I'm not sure how you think S-expressions are any more optimized for expressions than, for example, infix notation. That's exactly what I'm showing with the second example. I'm open to hearing why you think S-expressions are better for expressions, but I suspect any differences you might point out are pretty subjective.
> There are a lot of nice features falling out of that.
Really I can only identify one feature which falls out of S-expressions, which can't be obtained with other syntaxes: macros. And whether that's a good feature is pretty subjective: it's pretty arguably a misfeature in my experience.
> In my opinion it makes little sense to misuse it in order to show its utility.
Agreed: I'm not misusing S-expressions to show their utility.
I'm misusing S-expressions to show that they don't inherently give you the benefits of Lisp. And I'm showing Lisp-y code without S-expressions to show how the benefits of Lisp can be obtained without S-expressions.
1 reply →