3 ms·
> I don't feel bad in saying that I can't tell you what this line does without looking it up. This is something that you could learn in a single minute. It's
by Dylan16807 5y ago
> I don't feel bad in saying that I can't tell you what this line does without looking it up.
This is something that you could learn in a single minute.
It's faster to learn than all the languages you know.
> (reset! caret-location nil))))
The C version is reset(caret_location, nil)
Or to be more precise, reset(caret_location, nil))))
Maybe null or NIL instead of nil, maybe not.
It's barely different. And the exclamation point is just part of the function's name. I'm not sure what's so confusing.
- Noumenon72 5y agoAn exclamation point being part of a function's name is certainly surprising to me. It would be like learning that `foo[5]` was a function named `foo[` being called 5x or something.. (Apparently it's a ClojureScript convention to put an exclamation point on impure functions.)
- Dylan16807 5y agoEven though the blog is syntax highlighted?
- sixstringtheory 5y agoExclamation marks are also used in Ruby to differentiate between mutating methods vs those that return a transformed copy. So, `array.sort` vs `array.sort!`. Question marks are also used, but more aesthetically vs functionally: there are `array.empty?` and `array.include?` but no `array.empty` or `array.include`. Swift allows unicode in symbols, so you can name functions with emoji. Thankfully that hasn’t caught on. J has a similar idea–built into the language syntax vs using characters in function names–where a period can be used to inflect a primitive.
- tomlin 5y agoIt's not about having an open mind. I teach children to code, and you'll notice that there are ZERO early coding learning platforms that take a Lisp/Clojure approach. Do you think that is a coincidence or because it's an ugly language that people can't easily read at an early age?