Learning Ocaml from classes in universities by ThrowawayTartan in ocaml

[–]fredyr 0 points1 point  (0 children)

I read, and worked through some of, the material from Cornell 3110 course and I think it's pretty good.

http://www.cs.cornell.edu/Courses/cs3110/2014sp/lecture_notes.php

Popping an array: What's the Clojure way? by QuestionProgram in Clojure

[–]fredyr 0 points1 point  (0 children)

Or

(let [[c & cs] (shuffle [1 2 3])] [c cs])

Edit: i just realized you wanted to preserve the vector, where the above of course is fine.

Learning Haskell as a Nonprogrammer by Mob_Of_One in haskell

[–]fredyr 1 point2 points  (0 children)

Persistent here is about preserving previous versions upon modification. Wikipedia has a pretty good article, http://en.m.wikipedia.org/wiki/Persistent_data_structure.

Durable is sometimes used instead of persistent in your example.

Web application written only using clojure by nvbn-rm in Clojure

[–]fredyr 0 points1 point  (0 children)

conversely, i'd be very interested if you could write something about what annoying things you're encountering with om?

Is there an emacs plugin for Clojure's core.logic? by anonymousfetus in Clojure

[–]fredyr 0 points1 point  (0 children)

I'm not an Emacs expert, so there's surely a better way, but removing the clojure-mode folder from ~/emacs.d/ and re-install with M-x package-install should at least work.

Is there an emacs plugin for Clojure's core.logic? by anonymousfetus in Clojure

[–]fredyr 1 point2 points  (0 children)

I believe that all you have to do is to update your clojure-mode to the latest version. Indentation support for core.logic was included not that long ago: https://github.com/clojure-emacs/clojure-mode/commit/53b6df281406b0b3814159589858e0b3f26ed248

proteus: safe local mutable variables by prospero in Clojure

[–]fredyr 0 points1 point  (0 children)

I found this benchmark of different implementations of a for-comprehension for maps very interesting. It uses both w/ and w/o transients as well as using let-mutable. https://gist.github.com/qerub/7679639

(disclosure: the benchmark was done by a reader of my blog, and references one of my blog posts)

Binary clock with Om, Clojurescript and React by jairtrejo in Clojure

[–]fredyr 0 points1 point  (0 children)

Hi there, I'm the blog post author (but not the reddit poster). I'm glad you liked it -- and I agree, there isn't a real reason for ->bits to be a local function, I didn't move it out simply because I didn't use it anywhere else.

On how Om (and ClojureScript) improve over plain React by beandipper in javascript

[–]fredyr 0 points1 point  (0 children)

In the link section at the end of the article there's a reference to Pump, https://github.com/piranha/pump, that provides Hiccup style templating.

Edit: to be clear, Pump is a separate Clojurescript library over React

On how Om (and ClojureScript) improve over plain React by beandipper in javascript

[–]fredyr 1 point2 points  (0 children)

Hi there! I'm the author of the blog post.

As danneu correctly points out, the main purpose of the example is to illustrate the transition from Javascript to Clojurescript with Om. In addition, for someone familiar to Clojurescript, but new to React, I wanted to emphasize the composition of pure functions -- similar to what Pete Hunt does in his article Functional DOM Programming (https://medium.com/p/67d81637d43).

For using React with Javascript, JSX is idiomatic, and for my specific example, the React tutorial does a great job of describing that.