On Tue, Aug 28, 2012 at 7:01 PM, Brian Marick <mar...@exampler.com> wrote:
> Observe:
>
> user=> (defn count-sequence  [& seq]
>   (match [seq]
> ;   [([so-far [x & xs]] :seq)] (str "1:" so-far x xs)
>    [([[& sequence]] :seq)] (str "2:" sequence)))
> user=> (count-sequence [1 2 3])
> "2:[1 2 3]"
>
> Now uncomment the commented line:
>
> user=> (defn count-sequence  [& seq]
>   (match [seq]
>    [([so-far [x & xs]] :seq)] (str "1:" so-far x xs)
>    [([[& sequence]] :seq)] (str "2:" sequence)))
> user=> (count-sequence [1 2 3])
> nil
>
> This is a bug? Please?
>
> (Note: the same thing happens without a &rest argument if you pass in [[1 2 
> 3]])
>
> -----
> Brian Marick, Artisanal Labrador
> Contract programming in Ruby and Clojure
> Occasional consulting on Agile

There's definitely issues around seq pattern matching. I have a ticket
or two open for this. However the future of seq matching is still
uncertain.

David

-- 
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