3 ms·
This clearly isn't true, though. Lisps do have a lot of syntax. In the Clojure samples in this blog post alone we have: • Parens • Curly braces • Square brac
by thu2111 6y ago
This clearly isn't true, though. Lisps do have a lot of syntax. In the Clojure samples in this blog post alone we have:
• Parens
• Curly braces
• Square brackets (why are they here, if Lisp is just s-exprs?)
• Colon-prefixed symbols
• Quote-prefixed lists
• Functions with names like >!! and ->>
That's pretty obviously syntax. You could argue it doesn't have keywords in the way C-type languages do, but magical functions that are defined as part of the language and should never be changed for all intents and purposes might as well be syntax too. So in the end the difference is kind of academic.
- kamaal 6y agoSo if its not an issue in C languages, how come this is an issue in Clojure? The argument here is lisp has a simple rule. The first element of a list says that what is to be done, the remaining are its inputs. That's really all there is to it(mostly). Using () for everything was really a kind of overloading, which is why I guess they used different opening and closing characters for different contexts.
- dunefox 6y ago> • Functions with names like >!! and ->> To be precise, those are just function names, not syntax. But even Clojure having a more complicated syntax than Common Lisp or Scheme is much simpler than Java, for example. Instead of f(x, y) it's (f x y), essentially.
- thom 6y agoI'm not saying it doesn't have any symbols, and yes Clojure makes a pragmatic choice to include more primitives than just lists, I think people are pretty happy with that. But everything you mention was present in the very first release of Clojure (function names are just function names). The changes since then have been tiny (some reader stuff which you could easily ignore). My point is once you know how to read and navigate Clojure code you're never going to have to worry about new primitive stuff being added, because the syntax is enough for life. I like that, and dislike languages like C# where every release and every new language feature introduces new keywords. That's an entirely personal thing, I'm not saying it's better, but I do think it's to Clojure's credit that it doesn't have to add new syntax to get new things done.