Yes, transients mutate when updated. Seqs over sets are a immutable view
over a collection. So if someone did get this to work, the implementation
could be incorrect. And you could get something really strange like this:

(def s (transient #{1 2}))
(def sq (seq s))
(first sq) => 1
(disj s 1)
(second sq) => nil

There's a dozen things that could go really wrong here, but that's the gist
of it.

On Sat, Feb 24, 2018 at 8:14 AM, 'Alan Forrester' via Clojure <
clojure@googlegroups.com> wrote:

> Calling (first #{1}) gives the result 1.
>
> Calling (first (transient #{1})) gives an error:
>
> “IllegalArgumentException Don't know how to create ISeq from: clojure.lang.
> PersistentHashSet$TransientHashSet  clojure.lang.RT.seqFrom (RT.java:550)”
>
> Is this behaviour intended?
>
> And whether or not this is intentional is there a way round it?
>
> Alan Forrester
>
>
> --
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to