Earlier quoted context omitted.
Yes the annotations are purely optional.
Right, but the initial quote seemed to say that promoting to BigNums would no longer be automatic. But I may have misunderstood.
Clojure++ (notes from Rich Hickey talk)
31–40 of 45 posts
Re: Clojure++ (notes from Rich Hickey talk)
#32Earlier quoted context omitted.
Or (inc clojure) perhaps? Isn't (++) an abomination in functional programming with immutable state?
"(inc clojure)". which is probably really good marketing. (About e.g. "succ ml", I'm not sure.)
Rich Hickey loves to rail against nonsensical constructs/concepts like @date.day = 3, and I'm guessing he is very against the (++) method, as well. (How can you tell one number to become another number?)
Re: Clojure++ (notes from Rich Hickey talk)
#33Earlier quoted context omitted.
Or (inc clojure) perhaps? Isn't (++) an abomination in functional programming with immutable state?
(swap! clojure inc) is acceptable and a more literal translation, although refactoring your code to use (inc clojure) is usually more idiomatic. See also, ADD 1 TO COBOL GIVING COBOL.
Re: Clojure++ (notes from Rich Hickey talk)
#34Earlier quoted context omitted.
"(inc clojure)". which is probably really good marketing. (About e.g. "succ ml", I'm not sure.)
Well, I agree with you that isn't fantastic marketing. But neither is using a mutator function name to describe a talk on a functional language. Rich Hickey loves to rail against nonsensical constructs/concepts like @date.day = 3, and I'm guessing he is very against the (++) method, as well. (How can you tell one number to become another number?)
(I was thinking of tattoos, PS.)
Re: Clojure++ (notes from Rich Hickey talk)
#35Re: Clojure++ (notes from Rich Hickey talk)
#36Earlier quoted context omitted.
Well, I agree with you that isn't fantastic marketing. But neither is using a mutator function name to describe a talk on a functional language. Rich Hickey loves to rail against nonsensical constructs/concepts like @date.day = 3, and I'm guessing he is very against the (++) method, as well. (How can you tell one number to become another number?)
I haven't done anything with Clojure, though I'm curious and wondering if would be worth my while. I'm already familiar with languages covering similar territory (Erlang, other Lisp dialects), but I haven't done much with the JVM. Also, the lack of tail-call optimization in Clojure is off-putting to me, but it looks several good design trade-offs elsewhere would probably make up for it. (I was thinking of tattoos, PS…
Re: Clojure++ (notes from Rich Hickey talk)
#37Earlier quoted context omitted.
I haven't done anything with Clojure, though I'm curious and wondering if would be worth my while. I'm already familiar with languages covering similar territory (Erlang, other Lisp dialects), but I haven't done much with the JVM. Also, the lack of tail-call optimization in Clojure is off-putting to me, but it looks several good design trade-offs elsewhere would probably make up for it. (I was thinking of tattoos, PS…
I did not get the tatoo reference, haha. As far as I understand, though, there is TCO in Clojure, right? You just have to be explicit and use (recur).
With TCO, you can use a set of mutually-recursive functions - you can set up a FSM via tail calls, use CPS for backtracking (and many other things), a re-entrant virtual machine where each opcode is a tail call (rather than a giant switch/case or lots of gotos), etc. Being able to use function calls like "gotos with arguments" (but with local scopes, etc.) can make some constructs much easier to read, reason about, etc.
I'm not that familiar with the implementation of the JVM, but AFAICT it's due to difficulties setting up tail calls efficiently in JVM bytecode.
Re: Clojure++ (notes from Rich Hickey talk)
#38Earlier quoted context omitted.
I did not get the tatoo reference, haha. As far as I understand, though, there is TCO in Clojure, right? You just have to be explicit and use (recur).
That's not TCO, that's just an optimization for individual recursion. You might be able to use it for multiple forms under the same recur (like w/ "labels"), but it's very different when it applies to everything. With TCO, you can use a set of mutually -recursive functions - you can set up a FSM via tail calls, use CPS for backtracking (and many other things), a re-entrant virtual machine where each opcode is a tail…
Re: Clojure++ (notes from Rich Hickey talk)
#39shouldn't it be called (++ clojure) or something like it?
If I could do it again, I'd go with (inc clojure), as below.
Re: Clojure++ (notes from Rich Hickey talk)
#40Earlier quoted context omitted.
I did not get the tatoo reference, haha. As far as I understand, though, there is TCO in Clojure, right? You just have to be explicit and use (recur).
That's not TCO, that's just an optimization for individual recursion. You might be able to use it for multiple forms under the same recur (like w/ "labels"), but it's very different when it applies to everything. With TCO, you can use a set of mutually -recursive functions - you can set up a FSM via tail calls, use CPS for backtracking (and many other things), a re-entrant virtual machine where each opcode is a tail…
As soon as the JVM supports it Clojure will support it. For me recur and trampoline are quite ok. I would want to miss on clojure because of TCO but I don't know what would be possible with TCO. I hope I can learn that in one of the books I have here :)