My thought we to use the test cases as a specification for the desired
behavior.

1.  Assume that the following case is desired behavior

  [:a 1 2 :b 3] [[:a [1 2]] [:b 3]]

My thought was that "If it's a seq, flatten it". That lead me to
develop the test case above.  Here's how it works explicitly.

  user=> (seq {:a [1 2] :b 3})
  ([:a [1 2]] [:b 3])

Therefore...

  user=>(flatten (seq {:a [1 2] :b 3}))
  [:a 1 2 :b 3]

Is this the right specification, though?  That's the question for this
thread.

Sean


On Aug 8, 6:11 am, Meikel Brandmeyer <m...@kotka.de> wrote:
> Hi,
>
> Am 08.08.2009 um 07:36 schrieb Sean Devlin:
>
> > In my opinion, flatten to behave more like this:
>
> >http://gist.github.com/164291
>
> May I ask a stupid question?
>
> What is the use of this case:
>
>          [:a 1 2 :b 3] {:a [1 2] :b 3}
>
> Wouldn't it be more useful to flatten
> only depending on the outermost type?
>
>          [:a [1 2] :b 3] {:a [1 2] :b 3}
>          [:a :b {:foo :bar}] #{#{:a :b} #{{:foo :bar}}}
>
> Sincerely
> Meikel
>
>  smime.p7s
> 2KViewDownload
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to