jfr wrote:
> Hello,
>
> I've just started to play a little bit with clojure to get a feel for
> the language. It seems to be quite interesting (and it's a relief to
> leave my clumsy IDE behind and use Emacs). Concerning immutable data:
> Is the following code ok or should (must) I use transients as
> variables for the loop?
>

Transients are merely a performance optimisation, and they're designed
so that you can use them just like you would use persistent data
structures. Therefore it's good to always start with purely functional
algorithms. The code you wrote is idiomatic, though it could perhaps
be improved by not looping explicitly and instead using eg. reduce.
It's also fairly straightforward to transform to use transients,
should performance turn out to be suboptimal.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to