Re: Docs on standard protocols

2012-12-06 Thread Dmitry Groshev
Thanks a lot!

On Tuesday, November 27, 2012 4:15:55 PM UTC+4, Chas Emerick wrote:
>
> Having a good Java IDE around (e.g. Eclipse or IntelliJ) certainly 
> helps, though not so much in developing a comprehensive mental model 
> of how everything fits together. 
>
> Some years ago, Chris Houser worked at building static visualizations 
> of the core Clojure interfaces and abstract implementations, and how 
> those fed into the concrete implementations of maps, seqs, etc. that 
> we use daily: 
>
> 
> https://github.com/Chouser/clojure-classes/blob/master/graph-w-legend.png 
>
> I had similar objectives, but wanted to tie implementation details 
> (e.g. the Java interfaces that Clojure defined) together with related 
> functions, and the higher-level concepts that further related those 
> functions to others, etc.  Add in a dynamic visualization, and you get 
> Clojure Atlas: 
>
> http://www.clojureatlas.com 
>
> For example, here's the atlas focused on graph around 
> PersistentHashMap, the concrete implementation behind e.g. `{:a 1 :b 2} 
> `: 
>
> 
> http://www.clojureatlas.com/org.clojure:clojure:1.4.0?guest=t#clojure.lang.PersistentHashMap
>  
>
> Cheers, 
>
> - Chas 
>
> On Nov 26, 5:53 pm, Dmitry Groshev  wrote: 
> > Is there any reference of standard protocols in which one can 
> participate? 
> > When working with Java code and building bindings to complex Java 
> classes, 
> > it's sometimes handy to define instances of Seq (for example) for them. 
> But 
> > it's horribly troublesome to look up protocols in source code every 
> time. 
> > Can you please point me to appropriate documentation, if such exists? 
>

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

Re: Docs on standard protocols

2012-11-27 Thread Chas Emerick
Having a good Java IDE around (e.g. Eclipse or IntelliJ) certainly
helps, though not so much in developing a comprehensive mental model
of how everything fits together.

Some years ago, Chris Houser worked at building static visualizations
of the core Clojure interfaces and abstract implementations, and how
those fed into the concrete implementations of maps, seqs, etc. that
we use daily:

https://github.com/Chouser/clojure-classes/blob/master/graph-w-legend.png

I had similar objectives, but wanted to tie implementation details
(e.g. the Java interfaces that Clojure defined) together with related
functions, and the higher-level concepts that further related those
functions to others, etc.  Add in a dynamic visualization, and you get
Clojure Atlas:

http://www.clojureatlas.com

For example, here's the atlas focused on graph around
PersistentHashMap, the concrete implementation behind e.g. `{:a 1 :b 2}
`:


http://www.clojureatlas.com/org.clojure:clojure:1.4.0?guest=t#clojure.lang.PersistentHashMap

Cheers,

- Chas

On Nov 26, 5:53 pm, Dmitry Groshev  wrote:
> Is there any reference of standard protocols in which one can participate?
> When working with Java code and building bindings to complex Java classes,
> it's sometimes handy to define instances of Seq (for example) for them. But
> it's horribly troublesome to look up protocols in source code every time.
> Can you please point me to appropriate documentation, if such exists?

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


Re: Docs on standard protocols

2012-11-26 Thread Stuart Sierra
Unfortunately, I am not aware of any comprehensive documentation for the 
internal Java implementation of Clojure's core data types. The source code 
is the only definitive resource.

Introspection can help. For example, to get a list of everything you need 
to implement to support map-like behavior:

user=> (ancestors (class {}))
#{clojure.lang.IObj clojure.lang.Seqable clojure.lang.IHashEq 
clojure.lang.IMeta java.util.concurrent.Callable clojure.lang.IFn 
java.io.Serializable clojure.lang.IEditableCollection 
clojure.lang.APersistentMap clojure.lang.Associative java.util.Map 
clojure.lang.IPersistentCollection java.lang.Object clojure.lang.AFn 
java.lang.Runnable clojure.lang.Counted clojure.lang.MapEquivalence 
java.lang.Iterable clojure.lang.IPersistentMap clojure.lang.ILookup}


-S

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

Docs on standard protocols

2012-11-26 Thread Dmitry Groshev
Is there any reference of standard protocols in which one can participate? 
When working with Java code and building bindings to complex Java classes, 
it's sometimes handy to define instances of Seq (for example) for them. But 
it's horribly troublesome to look up protocols in source code every time. 
Can you please point me to appropriate documentation, if such exists?

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