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 <pup...@pupeno.com> http://pupeno.com On Jul 1, 2015 4:22 PM, "Mikera" <mike.r.anderson...@gmail.com> wrote: > 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 result but that >> '() is somewhat surprising. Would it be better if it raised an error when >> the attribute is not sequential? >> > > From an array programming / core.matrix perspective '(1) would be the most > logical result. > > Consider the logical sequence: > [[[1]]] = 3 dimensional array with elements '(1) > [[1]] = 2 dimensional array with elements '(1) > [1] =1 dimensional array with elements '(1) > 1 = 0 dimensional array (or "scalar") with elements '(1) > > I am not saying that this is necessarily the best behaviour to follow for > flatten, but it is an analogy worth considering. > > > -- > 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 > --- > You received this message because you are subscribed to a topic in the > Google Groups "Clojure" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/clojure/L6yf6iFPqe8/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.