Earlier quoted context omitted.
If we're golfing... (#(* %1 %2) 6 4)
I wonder, does #(* %1) do anything sensible?
It's a 1-argument function, so applying it to 2 arguments would give an error. Minus the arity error, 1-argument * is an identity.
151–160 of 261 posts
Earlier quoted context omitted.
If we're golfing... (#(* %1 %2) 6 4)
I wonder, does #(* %1) do anything sensible?
It's a 1-argument function, so applying it to 2 arguments would give an error. Minus the arity error, 1-argument * is an identity.
Earlier quoted context omitted.
Regarding the second point, why didn't you just define your own let macro? As a Java->Clojure guy I find better readability of Clojure's let compared to CL's support of transpose an acceptable tradeoff, but the point of being a lisp is that you are not constrained by all decisions of the boss?
Well yes, in theory, but it's generally considered in somewhat bad taste to replace fundamental basics of the language. At that point you're not really writing Clojure anymore, it's hard to read other people's code, it's hard for other people to read your code, etc. See the somewhat controversial Allegro CL IF* macro for an example of this (I think that's what it was called; turns out that's really hard to search for…
Earlier quoted context omitted.
Yes, I know there is Chicken Scheme and Guile. I prefer Clojure over them though.
For the niche that Python enjoys (data science, devops, machine learning) there's also Hy (hylang.org) which has more or less the same syntax as Clojure. With Clojurescript, Hy and Clojure you can use Clojure syntax in all 3 major layers: front-end, scripting and compiled/back-end.
Clojure's not dying, but it's also not thriving[1]. I think it will continue on as a solid niche language for the foreseeable future, but it's highly unlikely that the language will grow by leaps and bounds barring some must-have innovation in the Clojure language and/or ecosystem that gets the tech world to take it more seriously. There are so many options these days that it's tough to stand out from the crowd. Cloj…
Lisp used to be the language for AI, could Clojure possibly steal the machine learning niche back from Python?
Earlier quoted context omitted.
I always thought the Java tie-in was a double-edged sword. For some potential Clojure users, in addition to learning the language they were interested in, they'd also have to half-learn a language (and its tooling) that they probably weren't interested in. I guess in the US there is/was an assumption that everyone coming out of the computing education system is already experienced with Java.
I can't find the quote for the of me, but it was from Rich Hickey and went something like: "First, you use Clojure to escape Java. Then, you use Clojure to write better Java." I definitely found it to be true. Clojure takes the good parts of Java's OO system.
Oddly, as someone who was reasonably into Common Lisp, what really viscerally turned me off to Clojure was the use of square brackets. This sounds petty but I actually have some rationalization for it. Once you learn to read Lisp (mostly looking at the indentation and ignoring the parens) it's really nice that there's only one kind of delimiter in the language. It allows a lot of easy structure editing with a decent…
[1] http://www.ryan-williams.net/hacker-news-hiring-trends/2017/...
One of the best things about ClojureScript is the build process using lein. I've had a very stable build for years now, whereas JS has had grunt, growl, webpack, etc.
Yup, front end development is light years ahead of JS. sad
I think Clojurescript might be the thing. With advances in the Google Closure compiler, it's getting better and better. And the front end developer tools and libraries in Clojurescript are _the best_ out there. The holy grail for javascript exists in Clojurescript. Until then I'll keep making my Javascript env look like Clojurescript. With janky react devcards, Immutable.js, and react-redux.
As someone who writes JavaScript for a living (among bits of Java and Swift), I'm loving ClojureScript. I'm currently building a side project with it. But I am still a bit skittish of Clojure (JVM). The JVM just feels slow and cumbersome compared to what I'm used to (Node.js, Erlang/Elixir, Python). The lack of good error messages is manageable when combined with figwheel on the CLJS side, but there doesn't seem to b…
In what regard? Because the JVM is faster than all of the above.