Re: java interop, `(.instanceMember Classname)`

2017-03-20 Thread Alex Miller
If someone could file an issue on the clojure-site repo, I would be happy to 
improve the example. 

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


Re: Vars as global thread-locals?

2017-03-20 Thread Ernesto Garcia
Thanks for your response Didier.

On Friday, March 10, 2017 at 7:05:19 PM UTC+1, Didier wrote:
>
> But just to clarify, Java's ThreadLocal is an implementation of dynamic 
> scoping.
>

This is how I see it:

A ThreadLocal is an object instance. It ensures a different object for each 
different thread. It implements automatic thread-confinement. In 
particular, a ThreadLocal may be referenced by different vars. You may move 
its reference around the program and it will refer to the same object by 
the same thread.

Scoping refers to the ability to refer to a var. Dynamic scoping lets you 
use a var that should be declared by one of the functions up in the call 
stack. It implements an implicitly injected parameter to a function. A 
function that uses a dynamic var will see a different var depending on the 
last function in the call stack that defined it.

>

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


Re: java interop, `(.instanceMember Classname)`

2017-03-20 Thread Gregg Reynolds
On Mar 20, 2017 3:59 PM, "Colin Fleming" 
wrote:

Object doesn't have a getName() method.


sorry, of course you're right. it's java.lang.Class that has getName. as
you point out it's the doc that is suboptimal.


This doc is confusing - as Phill comments above, this is calling the
getName() method on an instance of Class. In Clojure, a bare classname
(String, ArrayList or whatever) resolves to the class itself if it has been
imported (i.e. what would be String.class in Java). The doc is confusing
because (.instanceMember Classname args*) is really just a special case
of (.instanceMember instance args*), where "instance" refers to an instance
of a Class object. I'm not sure why that doc makes that distinction, it
doesn't seem useful to me.

On 21 March 2017 at 09:49, Gregg Reynolds  wrote:

>
>
> On Mar 20, 2017 3:11 PM, "John Gabriele"  wrote:
>
> On Monday, March 20, 2017 at 4:14:46 AM UTC-4, Matching Socks wrote:
>>
>> Methods having the same name might be distinguished by their argument
>> lists.
>>
>
> Thanks, but it sounds like you're describing method overloading, as in
>
> (.someMethod someObj arg1) ; vs
> (.someMethod someObj arg1 arg2) ; different arity gets different method
>
> whereas I think I'm asking about what the `(.someMethod SomeClass ...)`
> syntax is supposed to mean (where it looks like one is trying to call an
> instance method on a Class (?).
>
>
> String inherits from Object, which has a getName method.
>
> Am I misunderstanding your reply?
>
> Thanks!
>
> --
> 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.
>
>
> --
> 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.
>

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

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


Re: java interop, `(.instanceMember Classname)`

2017-03-20 Thread Colin Fleming
Object doesn't have a getName() method.

This doc is confusing - as Phill comments above, this is calling the
getName() method on an instance of Class. In Clojure, a bare classname
(String, ArrayList or whatever) resolves to the class itself if it has been
imported (i.e. what would be String.class in Java). The doc is confusing
because (.instanceMember Classname args*) is really just a special case
of (.instanceMember instance args*), where "instance" refers to an instance
of a Class object. I'm not sure why that doc makes that distinction, it
doesn't seem useful to me.

On 21 March 2017 at 09:49, Gregg Reynolds  wrote:

>
>
> On Mar 20, 2017 3:11 PM, "John Gabriele"  wrote:
>
> On Monday, March 20, 2017 at 4:14:46 AM UTC-4, Matching Socks wrote:
>>
>> Methods having the same name might be distinguished by their argument
>> lists.
>>
>
> Thanks, but it sounds like you're describing method overloading, as in
>
> (.someMethod someObj arg1) ; vs
> (.someMethod someObj arg1 arg2) ; different arity gets different method
>
> whereas I think I'm asking about what the `(.someMethod SomeClass ...)`
> syntax is supposed to mean (where it looks like one is trying to call an
> instance method on a Class (?).
>
>
> String inherits from Object, which has a getName method.
>
> Am I misunderstanding your reply?
>
> Thanks!
>
> --
> 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.
>
>
> --
> 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.
>

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


Re: java interop, `(.instanceMember Classname)`

2017-03-20 Thread Gregg Reynolds
On Mar 20, 2017 3:11 PM, "John Gabriele"  wrote:

On Monday, March 20, 2017 at 4:14:46 AM UTC-4, Matching Socks wrote:
>
> Methods having the same name might be distinguished by their argument
> lists.
>

Thanks, but it sounds like you're describing method overloading, as in

(.someMethod someObj arg1) ; vs
(.someMethod someObj arg1 arg2) ; different arity gets different method

whereas I think I'm asking about what the `(.someMethod SomeClass ...)`
syntax is supposed to mean (where it looks like one is trying to call an
instance method on a Class (?).


String inherits from Object, which has a getName method.

Am I misunderstanding your reply?

Thanks!

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

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


Re: java interop, `(.instanceMember Classname)`

2017-03-20 Thread Gregg Reynolds
please ignore! sleep deprived.

On Mar 20, 2017 3:32 PM, "Gregg Reynolds"  wrote:



On Mar 20, 2017 3:11 PM, "John Gabriele"  wrote:

On Monday, March 20, 2017 at 4:14:46 AM UTC-4, Matching Socks wrote:
>
> Methods having the same name might be distinguished by their argument
> lists.
>

Thanks, but it sounds like you're describing method overloading, as in

(.someMethod someObj arg1) ; vs
(.someMethod someObj arg1 arg2) ; different arity gets different method

whereas I think I'm asking about what the `(.someMethod SomeClass ...)`
syntax is supposed to mean (where it looks like one is trying to call an
instance method on a Class


it's just an example of the difficulty of documenting abstractions.  just
replace "SomeClass" with "instanceOfSomeClass"

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


Re: java interop, `(.instanceMember Classname)`

2017-03-20 Thread Gregg Reynolds
On Mar 20, 2017 3:11 PM, "John Gabriele"  wrote:

On Monday, March 20, 2017 at 4:14:46 AM UTC-4, Matching Socks wrote:
>
> Methods having the same name might be distinguished by their argument
> lists.
>

Thanks, but it sounds like you're describing method overloading, as in

(.someMethod someObj arg1) ; vs
(.someMethod someObj arg1 arg2) ; different arity gets different method

whereas I think I'm asking about what the `(.someMethod SomeClass ...)`
syntax is supposed to mean (where it looks like one is trying to call an
instance method on a Class


it's just an example of the difficulty of documenting abstractions.  just
replace "SomeClass" with "instanceOfSomeClass"

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


Re: java interop, `(.instanceMember Classname)`

2017-03-20 Thread John Gabriele
On Monday, March 20, 2017 at 4:14:46 AM UTC-4, Matching Socks wrote:
>
> Methods having the same name might be distinguished by their argument 
> lists.
>

Thanks, but it sounds like you're describing method overloading, as in

(.someMethod someObj arg1) ; vs
(.someMethod someObj arg1 arg2) ; different arity gets different method

whereas I think I'm asking about what the `(.someMethod SomeClass ...)` 
syntax is supposed to mean (where it looks like one is trying to call an 
instance method on a Class (?).

Am I misunderstanding your reply?

Thanks!

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


Re: ANN: I wrote a beginner datomic tutorial I wanted to share with y'all, constructive feedback welcome

2017-03-20 Thread Gregg Reynolds
if you post a note to clojurians, we can give you editorial feedback useful
to you but very boring to everybody else.  example: instead of "...we have
to specify ahead of time which keywords entities in datomic are allowed to
use" i suggest sth like "... which keywords may be used by datomic
entities... "

On Mar 19, 2017 4:34 PM, "Fenton Travers"  wrote:

> https://www.reddit.com/r/Clojure/comments/5zu1oc/my_
> datomic_tutorial_feedback_sought/
>
> --
> 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.
>

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


Re: ANN: I wrote a beginner datomic tutorial I wanted to share with y'all, constructive feedback welcome

2017-03-20 Thread Gregg Reynolds
just starting on it but since you asked: the toc links do not seem to work,
at least not on my android phone. also fwiw i would suggest a direct link,
not a link to reddit, which some of us do not use.  better imho to post a
note to clojurians on slack.

On Mar 19, 2017 4:34 PM, "Fenton Travers"  wrote:

> https://www.reddit.com/r/Clojure/comments/5zu1oc/my_
> datomic_tutorial_feedback_sought/
>
> --
> 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.
>

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


Re: ANN: I wrote a beginner datomic tutorial I wanted to share with y'all, constructive feedback welcome

2017-03-20 Thread Luke Burton

> On Mar 19, 2017, at 2:34 PM, Fenton Travers  > wrote:
> 
> https://www.reddit.com/r/Clojure/comments/5zu1oc/my_datomic_tutorial_feedback_sought/
>  
> 

My feedback: this is really awesome for several reasons!

1) I really like the direct, unadorned descriptions you’ve used. While I’m a 
huge fan of Clojure for the Brave and True (and its spiritual ancestor: why’s 
poignant guide to Ruby), and refer a lot of people on to those resources, for 
me personally I really need to be taken straight to the point. "You can think 
about the data that is stored in datomic as just a bunch of maps” - perfect, 
that makes it feel like we’re standing at a whiteboard together and you’re 
trying to move us along quickly.

2) I feel that there aren’t many Clojure resources that directly explain a 
feature in terms of a similar feature in other contexts or languages (with the 
exception of Java). So I really appreciate the contrasts you’re drawing with 
SQL, because it helps me as a practicing programmer to jump straight to 
understanding how things are different. It’s like giving me just the patch I 
need for my brain, not the entire repo. 

3) Similarly, I like how you’ve made this contrast especially meaningful by 
highlighting two things. First, how Datomic solves a real pain point for me. I 
used to have to do SQL joins, which are ugly and tricky to get right, but now 
that pain is *gone*. Secondly, Datomic goes further by letting me do things 
that are basically impossible in regular SQL, namely, getting heterogeneous 
result sets based on “column” across the entire database. Boom, you just sold 
me on Datomic in a way that not much else has.

Why do I think this is important? I believe we have a lot of resources that 
explain how Clojure solves problems experienced by Java developers, by 
highlighting contrasts like this, but not so much for other technologies. Most 
Ruby or Python programmers don’t feel the pain of concurrent programming and so 
spending a lot of time on immutable data structures doesn’t feel very “real” to 
them. This is a crucial hook for beginner tutorials targeted at working 
programmers, you need that hook that makes them say “Holy crap, that’s 
something new, and it totally solves that pain. I really need to learn this"

4) Putting the tutorial and the code together in the same repo is nice. It 
removes yet another barrier to entry, I know when I read “and all the source 
code is available elsewhere at http://…” I almost never bother to chase it 
down. Being able to say “and the source code is right under your nose” is 
always great.

5) I’m not sure if you thought explicitly about your pacing, but you did a good 
job here too. Take big concept, break it up into smaller concepts, then bring 
each concept into focus. Acknowledge to the reader that certain concepts will 
remain fuzzy until we revisit them, and don’t take too long before you do that. 
Having to revisit a topic isn’t just an awkward thing you have to work around, 
if it’s well written it’s actually another “hook” that will keep people reading 
because it’s enticing to learn more.

6) The style of “let’s try this and see what we get? Hmm not quite right, but 
we can now do this …” is reminiscent of how we interact at the REPL, but I 
don’t think you encourage the reader to fire up the REPL and follow along. Some 
people might not even realize this is a thing you can do. Dare I say it, but 
perhaps the Klipse plugin would be an exciting addition to a tutorial like 
this. One could imagine making the training more “real” by actually asking the 
reader to demonstrate their understanding by producing some data that “unlocks” 
the next part of the tutorial. Just a thought …

All said and done, it looks like you put a ton of effort into writing this, and 
it was very worthwhile. I have already forwarded it to a bunch of colleagues 
who were Datomic-curious and had positive feedback. I hope you keep writing!

Luke.

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


Re: ANN: I wrote a beginner datomic tutorial I wanted to share with y'all, constructive feedback welcome

2017-03-20 Thread Alan Thompson
Looks like a good start.  If you are interested, you may find some of the
examples and helper functions from the Tupelo Datomic library useful:

https://github.com/cloojure/tupelo-datomic


Alan

On Sun, Mar 19, 2017 at 2:34 PM, Fenton Travers 
wrote:

> https://www.reddit.com/r/Clojure/comments/5zu1oc/my_
> datomic_tutorial_feedback_sought/
>
> --
> 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.
>

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


Re: [beginner] help understand this function

2017-03-20 Thread Luis P. Mendes
Thanks Walter!

sábado, 18 de Março de 2017 às 21:19:10 UTC, Walter van der Laan escreveu:
>
> The value of 'maps' can be, for example; [{:lat 1 :lng 4} {:lat 2 :lng 3}].
>
> If you enter (min [{:lat 1 :lng 4} {:lat 2 :lng 3}]) in the repl the 
> result will be {:lat 1 :lng 3}
>
> If you replace 'min' by its definition you get;
> (min [{:lat 1 :lng 4} {:lat 2 :lng 3}])
> =>
> (zipmap [:lat :lng]
> (map (fn [k] (apply clojure.core/min
>   (map k [{:lat 1 :lng 4} {:lat 2 :lng 
> 3}])))
>  [:lat :lng]))
>
> I hope this helps. Succes!
>
>

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


Re: java interop, `(.instanceMember Classname)`

2017-03-20 Thread Matching Socks
In (.getName String) String is an instance of the class Class.

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


Re: java interop, `(.instanceMember Classname)`

2017-03-20 Thread Matching Socks
Methods having the same name might be distinguished by their argument lists.

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


Re: [ANN] irresponsible/codependence 0.1.0 (dependency resolution for apps - a twist on integrant)

2017-03-20 Thread James Laver
Hi James,

It's nice to see that integrant now has support for multiple 
instantiations, good job!

I think it doesn't mean much for codependence though as I'm likely to 
extend it with more features soon that probably don't belong in integrant.

Cheers,
James

On Monday, March 20, 2017 at 8:44:16 AM UTC+1, James Reeves wrote:
>
> Nice work. The use of keys is interesting.
>
> I'm not sure of this affects Codependence, but I released a new version of 
> Integrant a few days ago that supports multiple components of the same type 
> via composite keys.
>
> - James
>
> On 19 March 2017 at 09:17, James Laver > 
> wrote:
>
>> Hi all,
>>
>> The Irresponsible Clojure Guild is pleased to announce codependence 0.1.0 
>> is now available on clojars.
>>
>> This library came about because I liked integrant, but I wanted a bit 
>> more flexibility. It's built upon integrant (which is cool, I ported it to 
>> clojurescript!) but with a twist.
>>
>> In ordinary integrant, you might specify an app like this (component 
>> configs elided for brevity):
>>
>> ```
>> {:http {}
>>  :db {}}
>> ```
>>
>> In codependence you specify them like this:
>>
>> ```
>> {:http {:co/tag :http/aleph}
>>  :db {:co/tag :db/utrecht}
>> ```
>>
>> In the first example, :http and :db are the tags one will register 
>> behaviour for. in the second, they are :http/aleph and :db/utrecht. 
>> integrant refs are unmodified
>>
>> This firstly means that one tag can instantiate multiple components of 
>> the same type and secondly makes it easier to ship predefined components 
>> and let a user stitch them together as config
>>
>> dep coord: [irresponsible/codependence "0.1.0"]
>> github: https://github.com/irresponsible/codependence
>>
>> Cheers,
>> James (and the ICG)
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@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+u...@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+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


Re: [ANN] irresponsible/codependence 0.1.0 (dependency resolution for apps - a twist on integrant)

2017-03-20 Thread James Reeves
Nice work. The use of keys is interesting.

I'm not sure of this affects Codependence, but I released a new version of
Integrant a few days ago that supports multiple components of the same type
via composite keys.

- James

On 19 March 2017 at 09:17, James Laver  wrote:

> Hi all,
>
> The Irresponsible Clojure Guild is pleased to announce codependence 0.1.0
> is now available on clojars.
>
> This library came about because I liked integrant, but I wanted a bit more
> flexibility. It's built upon integrant (which is cool, I ported it to
> clojurescript!) but with a twist.
>
> In ordinary integrant, you might specify an app like this (component
> configs elided for brevity):
>
> ```
> {:http {}
>  :db {}}
> ```
>
> In codependence you specify them like this:
>
> ```
> {:http {:co/tag :http/aleph}
>  :db {:co/tag :db/utrecht}
> ```
>
> In the first example, :http and :db are the tags one will register
> behaviour for. in the second, they are :http/aleph and :db/utrecht.
> integrant refs are unmodified
>
> This firstly means that one tag can instantiate multiple components of the
> same type and secondly makes it easier to ship predefined components and
> let a user stitch them together as config
>
> dep coord: [irresponsible/codependence "0.1.0"]
> github: https://github.com/irresponsible/codependence
>
> Cheers,
> James (and the ICG)
>
> --
> 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.
>

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


java interop, `(.instanceMember Classname)`

2017-03-20 Thread John Gabriele
In the [Java Interop Docs](https://clojure.org/reference/java_interop), 
what does the example

(.instanceMember Classname args*)

mean? (Looks like the example given at the top for that one is `(.getName 
String)`, but I don't see any `getName` method in the javadoc for 
java.lang.String.)

It's been a while since I've used Java. I understand the other examples 
there (accessing static and instance fields/members, and calling static and 
instance methods), but I don't understand what that above one means.

Thanks!

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