On Aug 4, 12:35 pm, Howard Lewis Ship <hls...@gmail.com> wrote:
> These aren't criticisms, just trying to understand this better.
>
> So assoc! etc. return a new instance of the transient?

They return the next value of the transient.

> Or do they
> return the same transient?

I'm not promising that they do.

>  If they return a new instance, what
> exactly is the advantage (though, obviously there is one, from the
> transcript).

Right.

> If they return the same instance do you prevent the
> calling code from invoking further changes or not?
>

This one I don't understand, you can use the return value, don't reuse
the argument. If your code is structured functionally and non-
persistently that is how it will be anyway.

> I like the idea of restricting the transient to just the originating thread.
>
> Does this mean we'll need a reduce!

No, reduce farms out the work to the reducing function and doesn't
create a composite data structure itself. The reducing fn might use a
transient but that's an implementation detail of it.

> and map!, etc?

No, map returns a sequence.

> Would there be an
> advantage to those? Is there an intersection (or potential danger)
> between transient structures and laziness?
>

Transient data structures should never be part of the public interface
of anything. They are just an implementation detail, an optimization,
e.g. into/vec/vector now use transients, but aren't now into!/vec!/
vector! - the transients are inside.

Hope that helps,

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