Chris Knott
04/09/2022, 12:51 PM(a b c)
. Clojure, on the other hand is generally admired for being more "practical". One of the main things Clojure introduced is vectors [a b c]
, and maps {:a b, :c d}
as first class syntax. I was reading some Lisp this week and my brain kept grating/complaining because I was seeing what are conceptually hashmaps written as what I was interpreting as a lists of pairs, something which I "know" to be different.
Conversely, I have always thought it was annoying that C++ has three different operators (::
, .
, ->
) that all essentially mean "member of". Would C# be better if you had to say System::Console.Print()
instead of System.Console.Print()
? No, I think most people would rarely feel the need to conceptually distinguish between these things, the C++ syntax is just annoying noise to me.
What is it that distinguishes Clojure's brilliant decision to expand the syntax, from C# brilliant decision to compress the syntax?
It implies to me that if there is a scale of simplicity-to-expressiveness, then humans just happen to sit at particular point on it. There's no particular "reason" for why these changes were right other than "they'd gone too far that way, go back this way". There's a local maximum somewhere in the middle.
I have been thinking about this simplicity-to-expressiveness scale recently as it irrationally annoys me that on WikiData, "instance of" is "just another relationship" (it's P31 - "citizen of" is P27!).
I think that RDF is far too far towards the "elegance" end of the spectrum and would greatly benefit from a Clojure-style acknowledgement that some things are more different, and should be more differentiated. Yeah, it's mildly interesting that Node-Rel-Node triples is all you need to describe an ontology, but that's not actually how people think about the world...ibdknox
04/09/2022, 3:10 PMibdknox
04/09/2022, 3:11 PMibdknox
04/09/2022, 3:12 PMJason Morris
04/09/2022, 3:34 PMguitarvydas
04/09/2022, 4:41 PMAndrew F
04/09/2022, 4:55 PM(group, selector) -> thing
. So it doesn't hide or obscure any semantics to use the same syntax. Lists and hash maps do not have the same signature; a list is flat, but there are internal relationships in the arguments to a hashmap. So it helps to have different syntax to remind you of that.Joshua Horowitz
04/10/2022, 3:46 AMRiley Stewart
04/12/2022, 6:20 PM(lists)
and [vecs]
as they aren't really orthogonal, and the maps are just lists of pairs, so malformed ones will be ambiguous as to whether they're missing a key or value, like { :a :c 2 }
, as opposed to Javascript's { a: , c: 2 }
.