On Tue, Aug 4, 2009 at 7:54 AM, Laurent PETIT<laurent.pe...@gmail.com> wrote:
> Looks very interesting !
>
> One question: wouldn't seem more natural to have transient named transient!
> and persistent! named persistent ?
>
> I see a call to transient as "Enter the mutable world", so it seems to me
> (transient! []) conveys more this meaning than (transient []).
>
> I see a call to persistent! as "Enter back the immutable world", so
> (persistent v) seems more interesting than (persistent! v) ?
>
> And also, there may be the use case where some pure functions would protect
> their arguments by calling persistent! on them :
>
> This:
> (defn some-fn [v]
>   (let [v (persistent v)] ...)
>
> looks better in a pure function than this:
> (defn some-fn [v]
>   (let [v (persistent! v)] ...)
> where the ! catches the eye ...
>

The transient function has no side effects, the persistent! function
does, thus the names.

Rich

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