On Mon, Oct 10, 2011 at 10:28 PM, Rob Lally <[email protected]> wrote:
> Would supporting other data structures make it slower when using vectors,
> or only when using non-vector seq's?
>
If we use :seq pattern matching, it will use first/rest. This can be very
expensive. Vectors will take a performance hit.
:vector matching uses subvec, which explains its advantages (speed) and
disadvantages (only supports vectors).
What I'm proposing is defaulting to :seq matching. It's very easy to "switch
on" :vector matching.
Something like
(match [v]
[[x & xs]] 1) <- :seq
(match [v]
[([x & xs] :vector)] 1) <- vector
Ambrose
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en