Yes, reading the source code and trying to understand why rest was being
called there is how I came up with this case.
On 2 July 2015 at 07:54, icamts wrote:
> Hi Pablo,
> I think you're right. Have a look at flatten source
>
> (defn flatten
> "Takes any nested combination of sequential things
Hi Pablo,
I think you're right. Have a look at flatten source
(defn flatten
"Takes any nested combination of sequential things (lists, vectors,
etc.) and returns their contents as a single, flat sequence.
(flatten nil) returns an empty sequence."
{:added "1.2"
:static true}
[x]
(fil
I agree with you Mikera, it also maintains the homogeneity of always
returning a sequence but some people disagreed with it, so an error might
be better.
--
J. Pablo Fernández
http://pupeno.com
On Jul 1, 2015 4:22 PM, "Mikera" wrote:
> On Wednesday, 1 July 2015 12:55:28 UTC+1, J. Pablo Fernánde
On Wednesday, 1 July 2015 12:55:28 UTC+1, J. Pablo Fernández wrote:
>
> Hello Clojurists,
>
> Today I was surprised by the result of (flatten 1) which is '(). I was
> expecting '(1) or an error. Talking in some other people in #clojure @
> clojurians.net, not everybody agrees that '(1) is a good
Hello Clojurists,
Today I was surprised by the result of (flatten 1) which is '(). I was
expecting '(1) or an error. Talking in some other people in #clojure @
clojurians.net, not everybody agrees that '(1) is a good result but that
'() is somewhat surprising. Would it be better if it raised an