

Clojure 1.4 released - ConstantineXVI
https://groups.google.com/forum/?fromgroups#!topic/clojure/H4f2nbB6gWI

======
ConstantineXVI
Changelog: <https://github.com/clojure/clojure/blob/master/changes.md>

------
simonb
mapv and reduce-kv are a great addition; not so much as a feature per se, but
rather as a testament of the core team being on the lookout for design
patterns that are actually symptoms of lacks in the language
[[http://c2.com/cgi/wiki?AreDesignPatternsMissingLanguageFeatu...](http://c2.com/cgi/wiki?AreDesignPatternsMissingLanguageFeatures)].

~~~
spacemanaki
I'm not really sure what you mean... unless I'm missing something mapv is the
same as (into [] (map ...)), and based on the source that appears to be
exactly what it is. reduce-kv is a bit more complicated but it's not really a
huge leap from reduce. Nice additions, to be sure, but are either really
design patterns that indicate some lack in Clojure 1.3?

~~~
simonb
Codebases were littered with (vec (map ...)) and (reduce (fn [acc [k v]] ...))
patterns which are nothing but noise. This change removes the need for that,
makes the intention clearer and in the case of reduce-kv removes the need for
lambdas in some cases (where it was used only for destructuring).

------
mahmud
Why are they working on _library_ things instead of _language_ things? Half of
the features they pushed out belong in user-land, not the core language.

~~~
cynicalkane
Lisps are designed such that the need to work on language things is minimal.
Clojure actually has more "language things" than your typical lisp. But anyway
you're gonna see more things belong in standard library land, because having a
good standard library is part of what makes a good language.

------
darklajid
Can anyone help me understand the usage of these literals (2.1.1, 2.1.2)? Why
and for what are they useful?

~~~
chc
What I want to know is, what's the benefit of representing your domain-
specific datatypes with a literal like #htmlelement [:div {:id "foo"}] rather
than just (htmlelement [:div {:id "foo"}])? It seems like all you save is one
character. Is there some other benefit I'm missing?

~~~
weavejester
Security. You can parse a reader literal without evaluating the resulting data
structure. If you're just reading and evaluating, you might find someone
injecting some malicious code in there. By using reader literals, you can
include custom types like dates or UUIDs or whatever, without needing to trust
the entity sending you the data.

~~~
chc
Oh, I think I get it now: The difference is that the data part of a reader
literal has a fixed form, while the argument to a function could be arbitrary
code. Is that right?

~~~
nickik
Yes and another thing is that when you want to use Clojure Data together with
other languages. You cant calls (mydate "15.11.2000") to a python runtime, to
understand it you would need a clojure runtime. When you send #mydate
"15.11.2000" you only need a clojure reader. What to do with the date literals
can be handled in a python function. The reader is a rather simple peace of
code.

------
NSMeta
Did post this earlier today.

<http://news.ycombinator.com/item?id=3857082>

