Thank you. This was a good idea: 

> So if your coworkers code just needs something iterable (for example), 
you may 

> not need to do any casting at all: just give him the vector.




On Sunday, October 4, 2015 at 9:39:36 PM UTC-4, Francis Avila wrote:
>
> Does he actually need a real arraylist, or will something fulfilling a 
> collection interface (Collection, Iterable, or List for example) be ok? 
> Many clojure types do not require any casting at all as long as the java 
> code writes to a collection interface and doesn't expect to be able to 
> mutate the object. (Both of these are good Java idioms: write to interfaces 
> not classes, and copy defensively.)
>
> So if your coworkers code just needs something iterable (for example), you 
> may not need to do any casting at all: just give him the vector.
>
> If your coworker's code needs a real ArrayList and can accept no 
> substitutes, (java.util.ArrayList. your-vector) will make an ArrayList copy 
> of a vector's contents.
>
>

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