I hesitate to modify the inheritance structure of Clojure's
interfaces.
ClojureCLR does follow ClojureJVM in providing support for these
interfaces in the abstract base classes underlying things such as
PersistentTreeMap.

In ClojureCLR 1.3-alpha:

public class PersistentTreeMap : APersistentMap, IObj,
                   Reversible, Sorted, IEnumerable<IMapEntry>,
IDictionary

public abstract class APersistentMap: AFn, IPersistentMap,
                   IDictionary, IEnumerable<IMapEntry>,
MapEquivalence,
                   IDictionary<Object,Object>

The only difference in 1.3-alpha versus 1.2 is that 1.3 adds the
generics IEnumerable<IMapEntry> and IDictionary<Object,Object> for
interop with System.Linq and related libraries.  1.2 does have the
IEnumerable defined.  The entries iterated are IMapEntry.

So you should be able cast directly to IEnumerable in either version,
without casting to PersistentTreeMap.

-David


On Mar 7, 5:54 pm, Timothy Pratley <timothyprat...@gmail.com> wrote:
> Feature request:
> It would be handy for ISeq to inherit IEnumerable.
> My use case is wanting to expose an IEnumerable "Values" from a
> Clojure IPersistentMap (vals ) call
> Currently I can do it easily enough by casting to PersistentTreeMap
> which has a .Values implementation, but I suspect there is probably a
> smarter solution... :)

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