Re: What's the point of -> ?

2013-03-13 Thread Marko Topolnik
On Tuesday, March 12, 2013 6:20:56 PM UTC+1, Sean Corfield wrote:

>
> > (as-> response x (:body x) (:postalCodes x) (map to-location x) (sort-by 
> > :city x)) 
>
> I like the new threading operators and I'm looking forward to using 
> them but I'm not sure this is better since you need some neutral 
> identifier that, in this expression, represents a map, a map, an array 
> and a sequence so the choice is either picking a good name for all of 
> those or something generic (most likely a punctuation symbol)... 
>

The best approach (for me) is always using the same symbol as a template 
placeholder, I like to think of it as "x marks the spot". Yes, it does 
require a new mind-crutch, specific to just that form, but I came to like 
it almost instantaneously---especially if you need to use x in more than 
one place within a threading step. If Clojure started out with just as->, 
it may have never occurred to anybody to ask for -> and ->>.

-Marko

-- 
-- 
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/groups/opt_out.




Re: What's the point of -> ?

2013-03-13 Thread Jason Wolfe
That's what <- is for :)

https://github.com/Prismatic/plumbing/blob/master/src/plumbing/core.clj#L234



On Tuesday, March 12, 2013 4:37:58 AM UTC-7, Marko Topolnik wrote:
>
> On Tuesday, March 12, 2013 10:54:35 AM UTC+1, Laurent PETIT wrote:
>
>>
>> or perhaps
>>
>> (-> response :body :postalCodes (->> (map to-location) (sort-by :city))) 
>>
>> :-)
>>
>
> Yes, jumping to ->> in the middle of -> works; it fails the other way 
> around. I was always frustrated by that asymmetry, hence my love for as-> :)
>
> -Marko
>
>

-- 
-- 
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/groups/opt_out.




Re: What causes the text that I print to the terminal to become mangled garbage?

2013-03-13 Thread Marko Topolnik
There *is* mutual exclusion on all Java output streams (as well as input 
streams) so at least individual prints should be atomic. Not that it will 
solve this, but still, this kind of granularity of interleaving is unusual. 
I have never seen it.

On Wednesday, March 13, 2013 4:27:00 AM UTC+1, Michael Klishin wrote:
>
> 2013/3/13 larry google groups >
>
>> At least some of this mangled text is coming from this function, which is 
>> called at startup and then runs in its own thread
>
>
> If your app itself prints stuff to stdout/stderr, it is likely to be 
> interleaved with the output from the spying thread.
> Thread execution order and time slicing is non-deterministic and nothing 
> synchronizes writing to stdout/stderr
> to enforce ordering.
> -- 
> MK
>
> http://github.com/michaelklishin
> http://twitter.com/michaelklishin
>  

-- 
-- 
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/groups/opt_out.




Re: What's the point of -> ?

2013-03-13 Thread Meikel Brandmeyer (kotarak)
Hi,

Am Dienstag, 12. März 2013 18:21:22 UTC+1 schrieb sw1nn:
>
> I find the need to switch between -> and ->> in a pipeline disturbs the 
> clarity of my code.
>

In my experience having problems with switching between -> and ->> is 
closely related to unknowingly  cross borders between collections land and 
sequence land. If you run into this quite often you might want to review 
your pipeline and check whether sequences are really what you want. 
(Compare: pop vs. butlast on a vector)

Meikel

-- 
-- 
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/groups/opt_out.




Re: What's the point of -> ?

2013-03-13 Thread Marko Topolnik
On Wednesday, March 13, 2013 9:11:44 AM UTC+1, Meikel Brandmeyer (kotarak) 
wrote:

> Am Dienstag, 12. März 2013 18:21:22 UTC+1 schrieb sw1nn:
>>
>> I find the need to switch between -> and ->> in a pipeline disturbs the 
>> clarity of my code.
>>
>
> In my experience having problems with switching between -> and ->> is 
> closely related to unknowingly  cross borders between collections land and 
> sequence land. If you run into this quite often you might want to review 
> your pipeline and check whether sequences are really what you want. 
> (Compare: pop vs. butlast on a vector)
>

One comon, and completely justified, case is starting with a seq, building 
a map from it, and then performing more operations on the map. A similar 
case is mixing seqy and stringy operations.

On a related note, a matching doto-as would be just as beneficial. I often 
find myself aching for it.

-Marko

-- 
-- 
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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread shlomivaknin
Hey Sean,

Your attempt worked because in Netty 4.0.0.Alpha8 
AbstractBootstrap
 was 
still  public.. Try it out with 4.0.0.Beta2..

Thanks!

On Wednesday, March 13, 2013 4:15:51 AM UTC+2, Sean Corfield wrote:
>
> On Tue, Mar 12, 2013 at 5:46 PM,  > 
> wrote: 
> > In my case i am trying to get clojure working with netty 4, here is the 
> > code: 
> > 
> > (def #^AbstractBootstrap b (ServerBootstrap.)) 
> > (.channel ^AbstractBootstrap b ^Class 
> > io.netty.channel.socket.nio.NioServerSocketChannel) 
> > 
> > which returns the error: 
> > java.lang.IllegalArgumentException: Can't call public method of 
> non-public 
> > class: public io.netty.bootstrap.AbstractBootstrap 
> > io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) 
> >  at clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88) 
>
> I can't reproduce this (with Clojure 1.5.1, Netty 4.0.0.Alpha8): 
>
> user=> (set! *warn-on-reflection* true) 
> true 
> user=> (import '(io.netty.bootstrap AbstractBootstrap ServerBootstrap)) 
> io.netty.bootstrap.ServerBootstrap 
> user=> (def b (ServerBootstrap.)) 
> #'user/b 
> user=> (.channel ^AbstractBootstrap b ^Class 
> io.netty.channel.socket.nio.NioServerSocketChannel) 
> # 
> user=> *clojure-version* 
> {:major 1, :minor 5, :incremental 1, :qualifier nil} 
> user=> 
>
>
> Can you provide more detail? 
> -- 
> Sean A Corfield -- (904) 302-SEAN 
> An Architect's View -- http://corfield.org/ 
> World Singles, LLC. -- http://worldsingles.com/ 
>
> "Perfection is the enemy of the good." 
> -- Gustave Flaubert, French realist novelist (1821-1880) 
>

-- 
-- 
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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread Marko Topolnik
When you annotate, is it a runtime or a compile-time error? I would be very 
surprised if it happened at runtime (when the function is actuall called).

On Wednesday, March 13, 2013 1:26:00 AM UTC+1, Shlomi Vaknin wrote:
>
> hey, I have a similar problem, even when i type annotate with clojure 1.5 
> i still get that error.. any suggestions?
>

-- 
-- 
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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread shlomivaknin
yes you are right, it is a compile-time error.. 

On Wednesday, March 13, 2013 11:19:25 AM UTC+2, Marko Topolnik wrote:
>
> When you annotate, is it a runtime or a compile-time error? I would be 
> very surprised if it happened at runtime (when the function is actuall 
> called).
>
> On Wednesday, March 13, 2013 1:26:00 AM UTC+1, Shlomi Vaknin wrote:
>>
>> hey, I have a similar problem, even when i type annotate with clojure 1.5 
>> i still get that error.. any suggestions?
>>
>

-- 
-- 
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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread shlomivaknin
here is the full exception when compiling:

Exception in thread "main" java.lang.IllegalArgumentException: Can't call 
public method of non-public class: public 
io.netty.bootstrap.AbstractBootstrap 
io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class), 
compiling:(netty.clj:31:1)
at clojure.lang.Compiler$InstanceMethodExpr.eval(Compiler.java:1453)
at clojure.lang.Compiler.compile1(Compiler.java:7153)
at clojure.lang.Compiler.compile(Compiler.java:7219)
at clojure.lang.RT.compile(RT.java:398)
at clojure.lang.RT.load(RT.java:438)
at clojure.lang.RT.load(RT.java:411)
at clojure.core$load$fn__5018.invoke(core.clj:5530)
at clojure.core$load.doInvoke(core.clj:5529)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5336)
at clojure.core$compile$fn__5023.invoke(core.clj:5541)
at clojure.core$compile.invoke(core.clj:5540)
at user$eval7.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:6619)
at clojure.lang.Compiler.eval(Compiler.java:6609)
at clojure.lang.Compiler.eval(Compiler.java:6582)
at clojure.core$eval.invoke(core.clj:2852)
at clojure.main$eval_opt.invoke(main.clj:308)
at clojure.main$initialize.invoke(main.clj:327)
at clojure.main$null_opt.invoke(main.clj:362)
at clojure.main$main.doInvoke(main.clj:440)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:419)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)
Caused by: java.lang.IllegalArgumentException: Can't call public method of 
non-public class: public io.netty.bootstrap.AbstractBootstrap 
io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class)


On Wednesday, March 13, 2013 11:21:40 AM UTC+2, shlomi...@gmail.com wrote:
>
> yes you are right, it is a compile-time error.. 
>
> On Wednesday, March 13, 2013 11:19:25 AM UTC+2, Marko Topolnik wrote:
>>
>> When you annotate, is it a runtime or a compile-time error? I would be 
>> very surprised if it happened at runtime (when the function is actuall 
>> called).
>>
>> On Wednesday, March 13, 2013 1:26:00 AM UTC+1, Shlomi Vaknin wrote:
>>>
>>> hey, I have a similar problem, even when i type annotate with clojure 
>>> 1.5 i still get that error.. any suggestions?
>>>
>>

-- 
-- 
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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread Marko Topolnik
It is almost certain that the method you want to call is inherited from a 
public ancestor. Annotate the call with that ancestor and it will work.

On Wednesday, March 13, 2013 10:23:31 AM UTC+1, shlomi...@gmail.com wrote:
>
> here is the full exception when compiling:
>
> Exception in thread "main" java.lang.IllegalArgumentException: Can't call 
> public method of non-public class: public 
> io.netty.bootstrap.AbstractBootstrap 
> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class), 
> compiling:(netty.clj:31:1)
> at clojure.lang.Compiler$InstanceMethodExpr.eval(Compiler.java:1453)
> at clojure.lang.Compiler.compile1(Compiler.java:7153)
> at clojure.lang.Compiler.compile(Compiler.java:7219)
>
> Caused by: java.lang.IllegalArgumentException: Can't call public method of 
> non-public class: public io.netty.bootstrap.AbstractBootstrap 
> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class)
>
>
> On Wednesday, March 13, 2013 11:21:40 AM UTC+2, shlomi...@gmail.com wrote:
>>
>> yes you are right, it is a compile-time error.. 
>>
>> On Wednesday, March 13, 2013 11:19:25 AM UTC+2, Marko Topolnik wrote:
>>>
>>> When you annotate, is it a runtime or a compile-time error? I would be 
>>> very surprised if it happened at runtime (when the function is actuall 
>>> called).
>>>
>>> On Wednesday, March 13, 2013 1:26:00 AM UTC+1, Shlomi Vaknin wrote:

 hey, I have a similar problem, even when i type annotate with clojure 
 1.5 i still get that error.. any suggestions?

>>>

-- 
-- 
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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread shlomivaknin
hey
we dont need to be almost certain, we can just look at the code : 
https://github.com/netty/netty/blob/master/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java
 and 
see that it is not a public ancestor. more then that, i annotated the code 
and it didnt work. here is a repl dump, same as Sean did:

; nREPL 0.1.6-preview
user> (set! *warn-on-reflection* true) 
true
user> (import '(io.netty.bootstrap AbstractBootstrap ServerBootstrap)) 
io.netty.bootstrap.ServerBootstrap
user> (def b (ServerBootstrap.)) 
#'user/b
user> (.channel ^AbstractBootstrap b ^Class 
io.netty.channel.socket.nio.NioServerSocketChannel) 
Reflection warning, NO_SOURCE_PATH:1:1 - call to channel can't be resolved.
IllegalArgumentException Can't call public method of non-public class: 
public io.netty.bootstrap.AbstractBootstrap 
io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) 
 clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88)
user>  *clojure-version* 
{:major 1, :minor 5, :incremental 1, :qualifier nil}



On Wednesday, March 13, 2013 11:34:33 AM UTC+2, Marko Topolnik wrote:
>
> It is almost certain that the method you want to call is inherited from a 
> public ancestor. Annotate the call with that ancestor and it will work.
>
> On Wednesday, March 13, 2013 10:23:31 AM UTC+1, shlomi...@gmail.com wrote:
>>
>> here is the full exception when compiling:
>>
>> Exception in thread "main" java.lang.IllegalArgumentException: Can't call 
>> public method of non-public class: public 
>> io.netty.bootstrap.AbstractBootstrap 
>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class), 
>> compiling:(netty.clj:31:1)
>> at clojure.lang.Compiler$InstanceMethodExpr.eval(Compiler.java:1453)
>> at clojure.lang.Compiler.compile1(Compiler.java:7153)
>> at clojure.lang.Compiler.compile(Compiler.java:7219)
>>
>> Caused by: java.lang.IllegalArgumentException: Can't call public method 
>> of non-public class: public io.netty.bootstrap.AbstractBootstrap 
>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class)
>>
>>
>> On Wednesday, March 13, 2013 11:21:40 AM UTC+2, shlomi...@gmail.comwrote:
>>>
>>> yes you are right, it is a compile-time error.. 
>>>
>>> On Wednesday, March 13, 2013 11:19:25 AM UTC+2, Marko Topolnik wrote:

 When you annotate, is it a runtime or a compile-time error? I would be 
 very surprised if it happened at runtime (when the function is actuall 
 called).

 On Wednesday, March 13, 2013 1:26:00 AM UTC+1, Shlomi Vaknin wrote:
>
> hey, I have a similar problem, even when i type annotate with clojure 
> 1.5 i still get that error.. any suggestions?
>


-- 
-- 
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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread Marko Topolnik
It does have a public descendant, though. It is not acceptable for you to 
annotate with ServerBootstrap? It really is bad practice to annotate with 
non-public classes.

On Wednesday, March 13, 2013 10:43:35 AM UTC+1, shlomi...@gmail.com wrote:
>
> hey
> we dont need to be almost certain, we can just look at the code : 
> https://github.com/netty/netty/blob/master/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java
>  and 
> see that it is not a public ancestor. more then that, i annotated the code 
> and it didnt work. here is a repl dump, same as Sean did:
>
> ; nREPL 0.1.6-preview
> user> (set! *warn-on-reflection* true) 
> true
> user> (import '(io.netty.bootstrap AbstractBootstrap ServerBootstrap)) 
> io.netty.bootstrap.ServerBootstrap
> user> (def b (ServerBootstrap.)) 
> #'user/b
> user> (.channel ^AbstractBootstrap b ^Class 
> io.netty.channel.socket.nio.NioServerSocketChannel) 
> Reflection warning, NO_SOURCE_PATH:1:1 - call to channel can't be resolved.
> IllegalArgumentException Can't call public method of non-public class: 
> public io.netty.bootstrap.AbstractBootstrap 
> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) 
>  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88)
> user>  *clojure-version* 
> {:major 1, :minor 5, :incremental 1, :qualifier nil}
>
>
>
> On Wednesday, March 13, 2013 11:34:33 AM UTC+2, Marko Topolnik wrote:
>>
>> It is almost certain that the method you want to call is inherited from a 
>> public ancestor. Annotate the call with that ancestor and it will work.
>>
>> On Wednesday, March 13, 2013 10:23:31 AM UTC+1, shlomi...@gmail.comwrote:
>>>
>>> here is the full exception when compiling:
>>>
>>> Exception in thread "main" java.lang.IllegalArgumentException: Can't 
>>> call public method of non-public class: public 
>>> io.netty.bootstrap.AbstractBootstrap 
>>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class), 
>>> compiling:(netty.clj:31:1)
>>> at clojure.lang.Compiler$InstanceMethodExpr.eval(Compiler.java:1453)
>>> at clojure.lang.Compiler.compile1(Compiler.java:7153)
>>> at clojure.lang.Compiler.compile(Compiler.java:7219)
>>>
>>> Caused by: java.lang.IllegalArgumentException: Can't call public method 
>>> of non-public class: public io.netty.bootstrap.AbstractBootstrap 
>>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class)
>>>
>>>
>>> On Wednesday, March 13, 2013 11:21:40 AM UTC+2, shlomi...@gmail.comwrote:

 yes you are right, it is a compile-time error.. 

 On Wednesday, March 13, 2013 11:19:25 AM UTC+2, Marko Topolnik wrote:
>
> When you annotate, is it a runtime or a compile-time error? I would be 
> very surprised if it happened at runtime (when the function is actuall 
> called).
>
> On Wednesday, March 13, 2013 1:26:00 AM UTC+1, Shlomi Vaknin wrote:
>>
>> hey, I have a similar problem, even when i type annotate with clojure 
>> 1.5 i still get that error.. any suggestions?
>>
>

-- 
-- 
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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread shlomivaknin
I fully agree with you, only it doesnt work.. ServerBootstrap does not 
override that specific method, which is what causing this pain, so i dont 
know what other options i have.

here is my attempt:

user> (.channel ^ServerBootstrap b ^Class 
io.netty.channel.socket.nio.NioServerSocketChannel)
Reflection warning, NO_SOURCE_PATH:1:1 - call to channel can't be resolved.
IllegalArgumentException Can't call public method of non-public class: 
public io.netty.bootstrap.AbstractBootstrap 
io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) 
 clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88)



On Wednesday, March 13, 2013 11:58:06 AM UTC+2, Marko Topolnik wrote:
>
> It does have a public descendant, though. It is not acceptable for you to 
> annotate with ServerBootstrap? It really is bad practice to annotate with 
> non-public classes.
>
> On Wednesday, March 13, 2013 10:43:35 AM UTC+1, shlomi...@gmail.com wrote:
>>
>> hey
>> we dont need to be almost certain, we can just look at the code : 
>> https://github.com/netty/netty/blob/master/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java
>>  and 
>> see that it is not a public ancestor. more then that, i annotated the code 
>> and it didnt work. here is a repl dump, same as Sean did:
>>
>> ; nREPL 0.1.6-preview
>> user> (set! *warn-on-reflection* true) 
>> true
>> user> (import '(io.netty.bootstrap AbstractBootstrap ServerBootstrap)) 
>> io.netty.bootstrap.ServerBootstrap
>> user> (def b (ServerBootstrap.)) 
>> #'user/b
>> user> (.channel ^AbstractBootstrap b ^Class 
>> io.netty.channel.socket.nio.NioServerSocketChannel) 
>> Reflection warning, NO_SOURCE_PATH:1:1 - call to channel can't be 
>> resolved.
>> IllegalArgumentException Can't call public method of non-public class: 
>> public io.netty.bootstrap.AbstractBootstrap 
>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) 
>>  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88)
>> user>  *clojure-version* 
>> {:major 1, :minor 5, :incremental 1, :qualifier nil}
>>
>>
>>
>> On Wednesday, March 13, 2013 11:34:33 AM UTC+2, Marko Topolnik wrote:
>>>
>>> It is almost certain that the method you want to call is inherited from 
>>> a public ancestor. Annotate the call with that ancestor and it will work.
>>>
>>> On Wednesday, March 13, 2013 10:23:31 AM UTC+1, shlomi...@gmail.comwrote:

 here is the full exception when compiling:

 Exception in thread "main" java.lang.IllegalArgumentException: Can't 
 call public method of non-public class: public 
 io.netty.bootstrap.AbstractBootstrap 
 io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class), 
 compiling:(netty.clj:31:1)
 at clojure.lang.Compiler$InstanceMethodExpr.eval(Compiler.java:1453)
 at clojure.lang.Compiler.compile1(Compiler.java:7153)
 at clojure.lang.Compiler.compile(Compiler.java:7219)

 Caused by: java.lang.IllegalArgumentException: Can't call public method 
 of non-public class: public io.netty.bootstrap.AbstractBootstrap 
 io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class)


 On Wednesday, March 13, 2013 11:21:40 AM UTC+2, shlomi...@gmail.comwrote:
>
> yes you are right, it is a compile-time error.. 
>
> On Wednesday, March 13, 2013 11:19:25 AM UTC+2, Marko Topolnik wrote:
>>
>> When you annotate, is it a runtime or a compile-time error? I would 
>> be very surprised if it happened at runtime (when the function is 
>> actuall 
>> called).
>>
>> On Wednesday, March 13, 2013 1:26:00 AM UTC+1, Shlomi Vaknin wrote:
>>>
>>> hey, I have a similar problem, even when i type annotate with 
>>> clojure 1.5 i still get that error.. any suggestions?
>>>
>>

-- 
-- 
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/groups/opt_out.




Re: Java interop with dynamic proxies

2013-03-13 Thread Thomas
@Brian

I want to translate the snippet above to Clojure.

@Jonathan

That is more or less what I tried, but I get this error:

 (.setName fred "fred")
UnsupportedOperationException setName 
 x.x.proxy$java.lang.Object$Fred$8b90692b.setName (:-1)

from Java it all works (albeit kinda mysteriously for me).

Thank in advance
Thomas


-- 
-- 
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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread Marko Topolnik
I see, that's very unfortunate then. It fails even when it is not actually 
making the reflective call. Your last recourse is writing your own code 
against the Java Reflection API, using *setAccesible(true)* if necessary.

On Wednesday, March 13, 2013 11:03:50 AM UTC+1, shlomi...@gmail.com wrote:
>
> I fully agree with you, only it doesnt work.. ServerBootstrap does not 
> override that specific method, which is what causing this pain, so i dont 
> know what other options i have.
>
> here is my attempt:
>
> user> (.channel ^ServerBootstrap b ^Class 
> io.netty.channel.socket.nio.NioServerSocketChannel)
> Reflection warning, NO_SOURCE_PATH:1:1 - call to channel can't be resolved.
> IllegalArgumentException Can't call public method of non-public class: 
> public io.netty.bootstrap.AbstractBootstrap 
> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) 
>  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88)
>
>
>
> On Wednesday, March 13, 2013 11:58:06 AM UTC+2, Marko Topolnik wrote:
>>
>> It does have a public descendant, though. It is not acceptable for you to 
>> annotate with ServerBootstrap? It really is bad practice to annotate with 
>> non-public classes.
>>
>> On Wednesday, March 13, 2013 10:43:35 AM UTC+1, shlomi...@gmail.comwrote:
>>>
>>> hey
>>> we dont need to be almost certain, we can just look at the code : 
>>> https://github.com/netty/netty/blob/master/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java
>>>  and 
>>> see that it is not a public ancestor. more then that, i annotated the code 
>>> and it didnt work. here is a repl dump, same as Sean did:
>>>
>>> ; nREPL 0.1.6-preview
>>> user> (set! *warn-on-reflection* true) 
>>> true
>>> user> (import '(io.netty.bootstrap AbstractBootstrap ServerBootstrap)) 
>>> io.netty.bootstrap.ServerBootstrap
>>> user> (def b (ServerBootstrap.)) 
>>> #'user/b
>>> user> (.channel ^AbstractBootstrap b ^Class 
>>> io.netty.channel.socket.nio.NioServerSocketChannel) 
>>> Reflection warning, NO_SOURCE_PATH:1:1 - call to channel can't be 
>>> resolved.
>>> IllegalArgumentException Can't call public method of non-public class: 
>>> public io.netty.bootstrap.AbstractBootstrap 
>>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) 
>>>  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88)
>>> user>  *clojure-version* 
>>> {:major 1, :minor 5, :incremental 1, :qualifier nil}
>>>
>>>
>>>
>>> On Wednesday, March 13, 2013 11:34:33 AM UTC+2, Marko Topolnik wrote:

 It is almost certain that the method you want to call is inherited from 
 a public ancestor. Annotate the call with that ancestor and it will work.

 On Wednesday, March 13, 2013 10:23:31 AM UTC+1, shlomi...@gmail.comwrote:
>
> here is the full exception when compiling:
>
> Exception in thread "main" java.lang.IllegalArgumentException: Can't 
> call public method of non-public class: public 
> io.netty.bootstrap.AbstractBootstrap 
> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class), 
> compiling:(netty.clj:31:1)
> at clojure.lang.Compiler$InstanceMethodExpr.eval(Compiler.java:1453)
> at clojure.lang.Compiler.compile1(Compiler.java:7153)
> at clojure.lang.Compiler.compile(Compiler.java:7219)
>
> Caused by: java.lang.IllegalArgumentException: Can't call public 
> method of non-public class: public io.netty.bootstrap.AbstractBootstrap 
> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class)
>
>
> On Wednesday, March 13, 2013 11:21:40 AM UTC+2, shlomi...@gmail.comwrote:
>>
>> yes you are right, it is a compile-time error.. 
>>
>> On Wednesday, March 13, 2013 11:19:25 AM UTC+2, Marko Topolnik wrote:
>>>
>>> When you annotate, is it a runtime or a compile-time error? I would 
>>> be very surprised if it happened at runtime (when the function is 
>>> actuall 
>>> called).
>>>
>>> On Wednesday, March 13, 2013 1:26:00 AM UTC+1, Shlomi Vaknin wrote:

 hey, I have a similar problem, even when i type annotate with 
 clojure 1.5 i still get that error.. any suggestions?

>>>

-- 
-- 
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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread shlomivaknin
hmmm, that what i was afraid of :)
ill take my chances harassing the netty people now before i go down that 
path..

On Wednesday, March 13, 2013 12:09:44 PM UTC+2, Marko Topolnik wrote:
>
> I see, that's very unfortunate then. It fails even when it is not actually 
> making the reflective call. Your last recourse is writing your own code 
> against the Java Reflection API, using *setAccesible(true)* if necessary.
>
> On Wednesday, March 13, 2013 11:03:50 AM UTC+1, shlomi...@gmail.com wrote:
>>
>> I fully agree with you, only it doesnt work.. ServerBootstrap does not 
>> override that specific method, which is what causing this pain, so i dont 
>> know what other options i have.
>>
>> here is my attempt:
>>
>> user> (.channel ^ServerBootstrap b ^Class 
>> io.netty.channel.socket.nio.NioServerSocketChannel)
>> Reflection warning, NO_SOURCE_PATH:1:1 - call to channel can't be 
>> resolved.
>> IllegalArgumentException Can't call public method of non-public class: 
>> public io.netty.bootstrap.AbstractBootstrap 
>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) 
>>  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88)
>>
>>
>>
>> On Wednesday, March 13, 2013 11:58:06 AM UTC+2, Marko Topolnik wrote:
>>>
>>> It does have a public descendant, though. It is not acceptable for you 
>>> to annotate with ServerBootstrap? It really is bad practice to annotate 
>>> with non-public classes.
>>>
>>> On Wednesday, March 13, 2013 10:43:35 AM UTC+1, shlomi...@gmail.comwrote:

 hey
 we dont need to be almost certain, we can just look at the code : 
 https://github.com/netty/netty/blob/master/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java
  and 
 see that it is not a public ancestor. more then that, i annotated the code 
 and it didnt work. here is a repl dump, same as Sean did:

 ; nREPL 0.1.6-preview
 user> (set! *warn-on-reflection* true) 
 true
 user> (import '(io.netty.bootstrap AbstractBootstrap ServerBootstrap)) 
 io.netty.bootstrap.ServerBootstrap
 user> (def b (ServerBootstrap.)) 
 #'user/b
 user> (.channel ^AbstractBootstrap b ^Class 
 io.netty.channel.socket.nio.NioServerSocketChannel) 
 Reflection warning, NO_SOURCE_PATH:1:1 - call to channel can't be 
 resolved.
 IllegalArgumentException Can't call public method of non-public class: 
 public io.netty.bootstrap.AbstractBootstrap 
 io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) 
  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88)
 user>  *clojure-version* 
 {:major 1, :minor 5, :incremental 1, :qualifier nil}



 On Wednesday, March 13, 2013 11:34:33 AM UTC+2, Marko Topolnik wrote:
>
> It is almost certain that the method you want to call is inherited 
> from a public ancestor. Annotate the call with that ancestor and it will 
> work.
>
> On Wednesday, March 13, 2013 10:23:31 AM UTC+1, shlomi...@gmail.comwrote:
>>
>> here is the full exception when compiling:
>>
>> Exception in thread "main" java.lang.IllegalArgumentException: Can't 
>> call public method of non-public class: public 
>> io.netty.bootstrap.AbstractBootstrap 
>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class), 
>> compiling:(netty.clj:31:1)
>> at clojure.lang.Compiler$InstanceMethodExpr.eval(Compiler.java:1453)
>> at clojure.lang.Compiler.compile1(Compiler.java:7153)
>> at clojure.lang.Compiler.compile(Compiler.java:7219)
>>
>> Caused by: java.lang.IllegalArgumentException: Can't call public 
>> method of non-public class: public io.netty.bootstrap.AbstractBootstrap 
>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class)
>>
>>
>> On Wednesday, March 13, 2013 11:21:40 AM UTC+2, shlomi...@gmail.comwrote:
>>>
>>> yes you are right, it is a compile-time error.. 
>>>
>>> On Wednesday, March 13, 2013 11:19:25 AM UTC+2, Marko Topolnik wrote:

 When you annotate, is it a runtime or a compile-time error? I would 
 be very surprised if it happened at runtime (when the function is 
 actuall 
 called).

 On Wednesday, March 13, 2013 1:26:00 AM UTC+1, Shlomi Vaknin wrote:
>
> hey, I have a similar problem, even when i type annotate with 
> clojure 1.5 i still get that error.. any suggestions?
>


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

Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread Marko Topolnik
The netty people are not to blame; harass Rich instead :)

On Wednesday, March 13, 2013 11:11:46 AM UTC+1, shlomi...@gmail.com wrote:
>
> hmmm, that what i was afraid of :)
> ill take my chances harassing the netty people now before i go down that 
> path..
>
> On Wednesday, March 13, 2013 12:09:44 PM UTC+2, Marko Topolnik wrote:
>>
>> I see, that's very unfortunate then. It fails even when it is not 
>> actually making the reflective call. Your last recourse is writing your own 
>> code against the Java Reflection API, using *setAccesible(true)* if 
>> necessary.
>>
>> On Wednesday, March 13, 2013 11:03:50 AM UTC+1, shlomi...@gmail.comwrote:
>>>
>>> I fully agree with you, only it doesnt work.. ServerBootstrap does not 
>>> override that specific method, which is what causing this pain, so i dont 
>>> know what other options i have.
>>>
>>> here is my attempt:
>>>
>>> user> (.channel ^ServerBootstrap b ^Class 
>>> io.netty.channel.socket.nio.NioServerSocketChannel)
>>> Reflection warning, NO_SOURCE_PATH:1:1 - call to channel can't be 
>>> resolved.
>>> IllegalArgumentException Can't call public method of non-public class: 
>>> public io.netty.bootstrap.AbstractBootstrap 
>>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) 
>>>  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88)
>>>
>>>
>>>
>>> On Wednesday, March 13, 2013 11:58:06 AM UTC+2, Marko Topolnik wrote:

 It does have a public descendant, though. It is not acceptable for you 
 to annotate with ServerBootstrap? It really is bad practice to annotate 
 with non-public classes.

 On Wednesday, March 13, 2013 10:43:35 AM UTC+1, shlomi...@gmail.comwrote:
>
> hey
> we dont need to be almost certain, we can just look at the code : 
> https://github.com/netty/netty/blob/master/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java
>  and 
> see that it is not a public ancestor. more then that, i annotated the 
> code 
> and it didnt work. here is a repl dump, same as Sean did:
>
> ; nREPL 0.1.6-preview
> user> (set! *warn-on-reflection* true) 
> true
> user> (import '(io.netty.bootstrap AbstractBootstrap ServerBootstrap)) 
> io.netty.bootstrap.ServerBootstrap
> user> (def b (ServerBootstrap.)) 
> #'user/b
> user> (.channel ^AbstractBootstrap b ^Class 
> io.netty.channel.socket.nio.NioServerSocketChannel) 
> Reflection warning, NO_SOURCE_PATH:1:1 - call to channel can't be 
> resolved.
> IllegalArgumentException Can't call public method of non-public class: 
> public io.netty.bootstrap.AbstractBootstrap 
> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) 
>  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88)
> user>  *clojure-version* 
> {:major 1, :minor 5, :incremental 1, :qualifier nil}
>
>
>
> On Wednesday, March 13, 2013 11:34:33 AM UTC+2, Marko Topolnik wrote:
>>
>> It is almost certain that the method you want to call is inherited 
>> from a public ancestor. Annotate the call with that ancestor and it will 
>> work.
>>
>> On Wednesday, March 13, 2013 10:23:31 AM UTC+1, shlomi...@gmail.comwrote:
>>>
>>> here is the full exception when compiling:
>>>
>>> Exception in thread "main" java.lang.IllegalArgumentException: Can't 
>>> call public method of non-public class: public 
>>> io.netty.bootstrap.AbstractBootstrap 
>>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class), 
>>> compiling:(netty.clj:31:1)
>>> at clojure.lang.Compiler$InstanceMethodExpr.eval(Compiler.java:1453)
>>> at clojure.lang.Compiler.compile1(Compiler.java:7153)
>>> at clojure.lang.Compiler.compile(Compiler.java:7219)
>>>
>>> Caused by: java.lang.IllegalArgumentException: Can't call public 
>>> method of non-public class: public io.netty.bootstrap.AbstractBootstrap 
>>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class)
>>>
>>>
>>> On Wednesday, March 13, 2013 11:21:40 AM UTC+2, 
>>> shlomi...@gmail.comwrote:

 yes you are right, it is a compile-time error.. 

 On Wednesday, March 13, 2013 11:19:25 AM UTC+2, Marko Topolnik 
 wrote:
>
> When you annotate, is it a runtime or a compile-time error? I 
> would be very surprised if it happened at runtime (when the function 
> is 
> actuall called).
>
> On Wednesday, March 13, 2013 1:26:00 AM UTC+1, Shlomi Vaknin wrote:
>>
>> hey, I have a similar problem, even when i type annotate with 
>> clojure 1.5 i still get that error.. any suggestions?
>>
>

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

Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread shlomivaknin
That is very true.

is here the right place? is there a a different group/forum for the 
language developers? should i file a bug on github?

On Wednesday, March 13, 2013 12:17:45 PM UTC+2, Marko Topolnik wrote:
>
> The netty people are not to blame; harass Rich instead :)
>
> On Wednesday, March 13, 2013 11:11:46 AM UTC+1, shlomi...@gmail.com wrote:
>>
>> hmmm, that what i was afraid of :)
>> ill take my chances harassing the netty people now before i go down that 
>> path..
>>
>> On Wednesday, March 13, 2013 12:09:44 PM UTC+2, Marko Topolnik wrote:
>>>
>>> I see, that's very unfortunate then. It fails even when it is not 
>>> actually making the reflective call. Your last recourse is writing your own 
>>> code against the Java Reflection API, using *setAccesible(true)* if 
>>> necessary.
>>>
>>> On Wednesday, March 13, 2013 11:03:50 AM UTC+1, shlomi...@gmail.comwrote:

 I fully agree with you, only it doesnt work.. ServerBootstrap does not 
 override that specific method, which is what causing this pain, so i dont 
 know what other options i have.

 here is my attempt:

 user> (.channel ^ServerBootstrap b ^Class 
 io.netty.channel.socket.nio.NioServerSocketChannel)
 Reflection warning, NO_SOURCE_PATH:1:1 - call to channel can't be 
 resolved.
 IllegalArgumentException Can't call public method of non-public class: 
 public io.netty.bootstrap.AbstractBootstrap 
 io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) 
  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88)



 On Wednesday, March 13, 2013 11:58:06 AM UTC+2, Marko Topolnik wrote:
>
> It does have a public descendant, though. It is not acceptable for you 
> to annotate with ServerBootstrap? It really is bad practice to annotate 
> with non-public classes.
>
> On Wednesday, March 13, 2013 10:43:35 AM UTC+1, shlomi...@gmail.comwrote:
>>
>> hey
>> we dont need to be almost certain, we can just look at the code : 
>> https://github.com/netty/netty/blob/master/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java
>>  and 
>> see that it is not a public ancestor. more then that, i annotated the 
>> code 
>> and it didnt work. here is a repl dump, same as Sean did:
>>
>> ; nREPL 0.1.6-preview
>> user> (set! *warn-on-reflection* true) 
>> true
>> user> (import '(io.netty.bootstrap AbstractBootstrap 
>> ServerBootstrap)) 
>> io.netty.bootstrap.ServerBootstrap
>> user> (def b (ServerBootstrap.)) 
>> #'user/b
>> user> (.channel ^AbstractBootstrap b ^Class 
>> io.netty.channel.socket.nio.NioServerSocketChannel) 
>> Reflection warning, NO_SOURCE_PATH:1:1 - call to channel can't be 
>> resolved.
>> IllegalArgumentException Can't call public method of non-public 
>> class: public io.netty.bootstrap.AbstractBootstrap 
>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) 
>>  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88)
>> user>  *clojure-version* 
>> {:major 1, :minor 5, :incremental 1, :qualifier nil}
>>
>>
>>
>> On Wednesday, March 13, 2013 11:34:33 AM UTC+2, Marko Topolnik wrote:
>>>
>>> It is almost certain that the method you want to call is inherited 
>>> from a public ancestor. Annotate the call with that ancestor and it 
>>> will 
>>> work.
>>>
>>> On Wednesday, March 13, 2013 10:23:31 AM UTC+1, 
>>> shlomi...@gmail.comwrote:

 here is the full exception when compiling:

 Exception in thread "main" java.lang.IllegalArgumentException: 
 Can't call public method of non-public class: public 
 io.netty.bootstrap.AbstractBootstrap 
 io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class), 
 compiling:(netty.clj:31:1)
 at clojure.lang.Compiler$InstanceMethodExpr.eval(Compiler.java:1453)
 at clojure.lang.Compiler.compile1(Compiler.java:7153)
 at clojure.lang.Compiler.compile(Compiler.java:7219)

 Caused by: java.lang.IllegalArgumentException: Can't call public 
 method of non-public class: public 
 io.netty.bootstrap.AbstractBootstrap 
 io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class)


 On Wednesday, March 13, 2013 11:21:40 AM UTC+2, 
 shlomi...@gmail.comwrote:
>
> yes you are right, it is a compile-time error.. 
>
> On Wednesday, March 13, 2013 11:19:25 AM UTC+2, Marko Topolnik 
> wrote:
>>
>> When you annotate, is it a runtime or a compile-time error? I 
>> would be very surprised if it happened at runtime (when the function 
>> is 
>> actuall called).
>>
>> On Wednesday, March 13, 2013 1:26:00 AM UTC+1, Shlomi Vaknin 
>> wrote:
>>>
>>> hey, I have a 

Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread Marko Topolnik
You should first make a minimal example that reproduces this. I've just 
failed to do so with the following:

abstract class AbstractParent {
public void x() { System.out.println("x"); }
}

public class ConcreteChild extends AbstractParent {
}

user> (set! *warn-on-reflection* true)
true
user> (.x (test.ConcreteChild.))
nil
user> (.x ^test.AbstractParent (test.ConcreteChild.))
nil
user> (def cc (test.ConcreteChild.))
#'user/cc
user> (.x cc)
Reflection warning, NO_SOURCE_PATH:1:1 - reference to field x can't be 
resolved.
nil
user> 

What must I add to break it?

On Wednesday, March 13, 2013 11:23:17 AM UTC+1, shlomi...@gmail.com wrote:
>
> That is very true.
>
> is here the right place? is there a a different group/forum for the 
> language developers? should i file a bug on github?
>
> On Wednesday, March 13, 2013 12:17:45 PM UTC+2, Marko Topolnik wrote:
>>
>> The netty people are not to blame; harass Rich instead :)
>>
>> On Wednesday, March 13, 2013 11:11:46 AM UTC+1, shlomi...@gmail.comwrote:
>>>
>>> hmmm, that what i was afraid of :)
>>> ill take my chances harassing the netty people now before i go down that 
>>> path..
>>>
>>> On Wednesday, March 13, 2013 12:09:44 PM UTC+2, Marko Topolnik wrote:

 I see, that's very unfortunate then. It fails even when it is not 
 actually making the reflective call. Your last recourse is writing your 
 own 
 code against the Java Reflection API, using *setAccesible(true)* if 
 necessary.

 On Wednesday, March 13, 2013 11:03:50 AM UTC+1, shlomi...@gmail.comwrote:
>
> I fully agree with you, only it doesnt work.. ServerBootstrap does not 
> override that specific method, which is what causing this pain, so i dont 
> know what other options i have.
>
> here is my attempt:
>
> user> (.channel ^ServerBootstrap b ^Class 
> io.netty.channel.socket.nio.NioServerSocketChannel)
> Reflection warning, NO_SOURCE_PATH:1:1 - call to channel can't be 
> resolved.
> IllegalArgumentException Can't call public method of non-public class: 
> public io.netty.bootstrap.AbstractBootstrap 
> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) 
>  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88)
>
>
>
> On Wednesday, March 13, 2013 11:58:06 AM UTC+2, Marko Topolnik wrote:
>>
>> It does have a public descendant, though. It is not acceptable for 
>> you to annotate with ServerBootstrap? It really is bad practice to 
>> annotate 
>> with non-public classes.
>>
>> On Wednesday, March 13, 2013 10:43:35 AM UTC+1, shlomi...@gmail.comwrote:
>>>
>>> hey
>>> we dont need to be almost certain, we can just look at the code : 
>>> https://github.com/netty/netty/blob/master/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java
>>>  and 
>>> see that it is not a public ancestor. more then that, i annotated the 
>>> code 
>>> and it didnt work. here is a repl dump, same as Sean did:
>>>
>>> ; nREPL 0.1.6-preview
>>> user> (set! *warn-on-reflection* true) 
>>> true
>>> user> (import '(io.netty.bootstrap AbstractBootstrap 
>>> ServerBootstrap)) 
>>> io.netty.bootstrap.ServerBootstrap
>>> user> (def b (ServerBootstrap.)) 
>>> #'user/b
>>> user> (.channel ^AbstractBootstrap b ^Class 
>>> io.netty.channel.socket.nio.NioServerSocketChannel) 
>>> Reflection warning, NO_SOURCE_PATH:1:1 - call to channel can't be 
>>> resolved.
>>> IllegalArgumentException Can't call public method of non-public 
>>> class: public io.netty.bootstrap.AbstractBootstrap 
>>> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class) 
>>>  clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:88)
>>> user>  *clojure-version* 
>>> {:major 1, :minor 5, :incremental 1, :qualifier nil}
>>>
>>>
>>>
>>> On Wednesday, March 13, 2013 11:34:33 AM UTC+2, Marko Topolnik wrote:

 It is almost certain that the method you want to call is inherited 
 from a public ancestor. Annotate the call with that ancestor and it 
 will 
 work.

 On Wednesday, March 13, 2013 10:23:31 AM UTC+1, 
 shlomi...@gmail.comwrote:
>
> here is the full exception when compiling:
>
> Exception in thread "main" java.lang.IllegalArgumentException: 
> Can't call public method of non-public class: public 
> io.netty.bootstrap.AbstractBootstrap 
> io.netty.bootstrap.AbstractBootstrap.channel(java.lang.Class), 
> compiling:(netty.clj:31:1)
> at 
> clojure.lang.Compiler$InstanceMethodExpr.eval(Compiler.java:1453)
> at clojure.lang.Compiler.compile1(Compiler.java:7153)
> at clojure.lang.Compiler.compile(Compiler.java:7219)
>
> Caused by: java.lang.IllegalArgumentException: Can't call public 
> metho

Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread Marko Topolnik
I did it: the method must be final. Apparently without that the child is 
compiled with an overriding method that I didn't even define!

On Wednesday, March 13, 2013 11:27:55 AM UTC+1, Marko Topolnik wrote:
>
> You should first make a minimal example that reproduces this. I've just 
> failed to do so with the following:
>
> abstract class AbstractParent {
> public void x() { System.out.println("x"); }
> }
>
> public class ConcreteChild extends AbstractParent {
> }
>
> user> (set! *warn-on-reflection* true)
> true
> user> (.x (test.ConcreteChild.))
> nil
> user> (.x ^test.AbstractParent (test.ConcreteChild.))
> nil
> user> (def cc (test.ConcreteChild.))
> #'user/cc
> user> (.x cc)
> Reflection warning, NO_SOURCE_PATH:1:1 - reference to field x can't be 
> resolved.
> nil
> user> 
>
> What must I add to break 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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread Marko Topolnik
Detailed finding: it *doesn't* fail at compile time; it always fails at 
runtime.

Reason: at compile time there is a *reflection warning*, which means that 
the method wasn't found and a reflective call was emited by the compiler.

On Wednesday, March 13, 2013 11:31:08 AM UTC+1, Marko Topolnik wrote:
>
> I did it: the method must be final. Apparently without that the child is 
> compiled with an overriding method that I didn't even define!
>
> On Wednesday, March 13, 2013 11:27:55 AM UTC+1, Marko Topolnik wrote:
>>
>> You should first make a minimal example that reproduces this. I've just 
>> failed to do so with the following:
>>
>> abstract class AbstractParent {
>> public void x() { System.out.println("x"); }
>> }
>>
>> public class ConcreteChild extends AbstractParent {
>> }
>>
>> user> (set! *warn-on-reflection* true)
>> true
>> user> (.x (test.ConcreteChild.))
>> nil
>> user> (.x ^test.AbstractParent (test.ConcreteChild.))
>> nil
>> user> (def cc (test.ConcreteChild.))
>> #'user/cc
>> user> (.x cc)
>> Reflection warning, NO_SOURCE_PATH:1:1 - reference to field x can't be 
>> resolved.
>> nil
>> user> 
>>
>> What must I add to break 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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread Marko Topolnik
You didn't recompile everything, that's the reason. I got the same error 
the first time, that's how I realized that the child had overridden the 
method. This is an interesting finding in itself: javac provides the 
override precisely to avoid pitfalls such as this one. If the parent was 
public, this wouldn't have happened.

Anyway, to make it really minimal, put all the java code into a single 
ConcreteChild.java.

On Wednesday, March 13, 2013 11:36:05 AM UTC+1, Shlomi Vaknin wrote:
>
> are you getting the same error? i was getting 
> clojure.lang.Compiler$CompilerException: java.lang.VerifyError: class Test 
> overrides final method methodA.()I, compiling:(NO_SOURCE_PATH:2)
>
> what is your code?
>
>
> On Wed, Mar 13, 2013 at 12:31 PM, Marko Topolnik 
> 
> > wrote:
>
>> I did it: the method must be final. Apparently without that the child is 
>> compiled with an overriding method that I didn't even define!
>>
>>

-- 
-- 
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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread shlomivaknin
very interesting.. are you getting the same error as i originally got?

On Wednesday, March 13, 2013 12:38:26 PM UTC+2, Marko Topolnik wrote:
>
> Detailed finding: it *doesn't* fail at compile time; it always fails at 
> runtime.
>
> Reason: at compile time there is a *reflection warning*, which means that 
> the method wasn't found and a reflective call was emited by the compiler.
>
> On Wednesday, March 13, 2013 11:31:08 AM UTC+1, Marko Topolnik wrote:
>>
>> I did it: the method must be final. Apparently without that the child is 
>> compiled with an overriding method that I didn't even define!
>>
>> On Wednesday, March 13, 2013 11:27:55 AM UTC+1, Marko Topolnik wrote:
>>>
>>> You should first make a minimal example that reproduces this. I've just 
>>> failed to do so with the following:
>>>
>>> abstract class AbstractParent {
>>> public void x() { System.out.println("x"); }
>>> }
>>>
>>> public class ConcreteChild extends AbstractParent {
>>> }
>>>
>>> user> (set! *warn-on-reflection* true)
>>> true
>>> user> (.x (test.ConcreteChild.))
>>> nil
>>> user> (.x ^test.AbstractParent (test.ConcreteChild.))
>>> nil
>>> user> (def cc (test.ConcreteChild.))
>>> #'user/cc
>>> user> (.x cc)
>>> Reflection warning, NO_SOURCE_PATH:1:1 - reference to field x can't be 
>>> resolved.
>>> nil
>>> user> 
>>>
>>> What must I add to break 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/groups/opt_out.




Re: Java interop with dynamic proxies

2013-03-13 Thread Gary Verhaegen
It would help if you could give an executable representative case (if
the library you are trying to use is not freely available, maybe try
to find an open source library that has a similar interface ? I am by
no means a Java wizard, but it seems pretty idiomatic).

On 13 March 2013 11:06, Thomas  wrote:
> @Brian
>
> I want to translate the snippet above to Clojure.
>
> @Jonathan
>
> That is more or less what I tried, but I get this error:
>
>  (.setName fred "fred")
> UnsupportedOperationException setName
> x.x.proxy$java.lang.Object$Fred$8b90692b.setName (:-1)
>
> from Java it all works (albeit kinda mysteriously for me).
>
> Thank in advance
> Thomas
>
>
> --
> --
> 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/groups/opt_out.
>
>

-- 
-- 
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/groups/opt_out.




Re: Clojure HTML5 Game Development

2013-03-13 Thread Mikera
On Wednesday, 13 March 2013 04:34:21 UTC+8, Reginald Choudari wrote:

> Any resources/people dedicated to game development using 
> Clojure/Clojurescript?
> I have made a couple games using HTML5/Javascript with the canvas element, 
> and seeing that Clojurescript can replace Javascript coupled with Clojure 
> hosting an HTTP web server, I was thinking of moving over to the Clojure 
> way of coding things.. Any suggestions?
>

You might want to take a look at using LibGDX: I've heard good things about 
it and will probably give it a go for my next game project:

http://libgdx.badlogicgames.com/

Apparently a few folks are using it to write android games in Clojure, but 
it should also be fully cross-platform (e.g. desktop / web as well)

-- 
-- 
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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread Marko Topolnik
Yes, the error is there. I also created a *lein new app* project, which by 
default creates a gen-classed main namespace:

(ns call-test.core (:gen-class))
(set! *warn-on-reflection* true)
(defn -main [& args] (.x (test.ConcreteChild.)))

Now try *lein do clean, uberjar. *It will report a reflection warning while 
AOT-compiling. 

Then do *java -jar target/call-test-0.1.0-SNAPSHOT-standalone.jar *and see 
it fail.

This cleanly separates compile time from runtime.

On Wednesday, March 13, 2013 11:44:05 AM UTC+1, shlomi...@gmail.com wrote:
>
> very interesting.. are you getting the same error as i originally got?
>
> On Wednesday, March 13, 2013 12:38:26 PM UTC+2, Marko Topolnik wrote:
>>
>> Detailed finding: it *doesn't* fail at compile time; it always fails at 
>> runtime.
>>
>> Reason: at compile time there is a *reflection warning*, which means 
>> that the method wasn't found and a reflective call was emited by the 
>> compiler.
>>
>> On Wednesday, March 13, 2013 11:31:08 AM UTC+1, Marko Topolnik wrote:
>>>
>>> I did it: the method must be final. Apparently without that the child is 
>>> compiled with an overriding method that I didn't even define!
>>>
>>> On Wednesday, March 13, 2013 11:27:55 AM UTC+1, Marko Topolnik wrote:

 You should first make a minimal example that reproduces this. I've just 
 failed to do so with the following:

 abstract class AbstractParent {
 public void x() { System.out.println("x"); }
 }

 public class ConcreteChild extends AbstractParent {
 }

 user> (set! *warn-on-reflection* true)
 true
 user> (.x (test.ConcreteChild.))
 nil
 user> (.x ^test.AbstractParent (test.ConcreteChild.))
 nil
 user> (def cc (test.ConcreteChild.))
 #'user/cc
 user> (.x cc)
 Reflection warning, NO_SOURCE_PATH:1:1 - reference to field x can't be 
 resolved.
 nil
 user> 

 What must I add to break 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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread shlomivaknin
right, i managed to reproduce it here, thanks!

so i am opening a bug and linking back here

On Wednesday, March 13, 2013 12:48:43 PM UTC+2, Marko Topolnik wrote:
>
> Yes, the error is there. I also created a *lein new app* project, which 
> by default creates a gen-classed main namespace:
>
> (ns call-test.core (:gen-class))
> (set! *warn-on-reflection* true)
> (defn -main [& args] (.x (test.ConcreteChild.)))
>
> Now try *lein do clean, uberjar. *It will report a reflection warning 
> while AOT-compiling. 
>
> Then do *java -jar target/call-test-0.1.0-SNAPSHOT-standalone.jar *and 
> see it fail.
>
> This cleanly separates compile time from runtime.
>
> On Wednesday, March 13, 2013 11:44:05 AM UTC+1, shlomi...@gmail.com wrote:
>>
>> very interesting.. are you getting the same error as i originally got?
>>
>> On Wednesday, March 13, 2013 12:38:26 PM UTC+2, Marko Topolnik wrote:
>>>
>>> Detailed finding: it *doesn't* fail at compile time; it always fails at 
>>> runtime.
>>>
>>> Reason: at compile time there is a *reflection warning*, which means 
>>> that the method wasn't found and a reflective call was emited by the 
>>> compiler.
>>>
>>> On Wednesday, March 13, 2013 11:31:08 AM UTC+1, Marko Topolnik wrote:

 I did it: the method must be final. Apparently without that the child 
 is compiled with an overriding method that I didn't even define!

 On Wednesday, March 13, 2013 11:27:55 AM UTC+1, Marko Topolnik wrote:
>
> You should first make a minimal example that reproduces this. I've 
> just failed to do so with the following:
>
> abstract class AbstractParent {
> public void x() { System.out.println("x"); }
> }
>
> public class ConcreteChild extends AbstractParent {
> }
>
> user> (set! *warn-on-reflection* true)
> true
> user> (.x (test.ConcreteChild.))
> nil
> user> (.x ^test.AbstractParent (test.ConcreteChild.))
> nil
> user> (def cc (test.ConcreteChild.))
> #'user/cc
> user> (.x cc)
> Reflection warning, NO_SOURCE_PATH:1:1 - reference to field x can't be 
> resolved.
> nil
> user> 
>
> What must I add to break 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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread shlomivaknin
here is the bug report: http://dev.clojure.org/jira/browse/CLJ-1183

Thanks!

On Wednesday, March 13, 2013 1:02:25 PM UTC+2, shlomi...@gmail.com wrote:
>
> right, i managed to reproduce it here, thanks!
>
> so i am opening a bug and linking back here
>
> On Wednesday, March 13, 2013 12:48:43 PM UTC+2, Marko Topolnik wrote:
>>
>> Yes, the error is there. I also created a *lein new app* project, which 
>> by default creates a gen-classed main namespace:
>>
>> (ns call-test.core (:gen-class))
>> (set! *warn-on-reflection* true)
>> (defn -main [& args] (.x (test.ConcreteChild.)))
>>
>> Now try *lein do clean, uberjar. *It will report a reflection warning 
>> while AOT-compiling. 
>>
>> Then do *java -jar target/call-test-0.1.0-SNAPSHOT-standalone.jar *and 
>> see it fail.
>>
>> This cleanly separates compile time from runtime.
>>
>> On Wednesday, March 13, 2013 11:44:05 AM UTC+1, shlomi...@gmail.comwrote:
>>>
>>> very interesting.. are you getting the same error as i originally got?
>>>
>>> On Wednesday, March 13, 2013 12:38:26 PM UTC+2, Marko Topolnik wrote:

 Detailed finding: it *doesn't* fail at compile time; it always fails 
 at runtime.

 Reason: at compile time there is a *reflection warning*, which means 
 that the method wasn't found and a reflective call was emited by the 
 compiler.

 On Wednesday, March 13, 2013 11:31:08 AM UTC+1, Marko Topolnik wrote:
>
> I did it: the method must be final. Apparently without that the child 
> is compiled with an overriding method that I didn't even define!
>
> On Wednesday, March 13, 2013 11:27:55 AM UTC+1, Marko Topolnik wrote:
>>
>> You should first make a minimal example that reproduces this. I've 
>> just failed to do so with the following:
>>
>> abstract class AbstractParent {
>> public void x() { System.out.println("x"); }
>> }
>>
>> public class ConcreteChild extends AbstractParent {
>> }
>>
>> user> (set! *warn-on-reflection* true)
>> true
>> user> (.x (test.ConcreteChild.))
>> nil
>> user> (.x ^test.AbstractParent (test.ConcreteChild.))
>> nil
>> user> (def cc (test.ConcreteChild.))
>> #'user/cc
>> user> (.x cc)
>> Reflection warning, NO_SOURCE_PATH:1:1 - reference to field x can't 
>> be resolved.
>> nil
>> user> 
>>
>> What must I add to break 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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread Marko Topolnik
Hm. You shouldn't have made ConcreteChild a nested class, that is a 
distraction that may set people on a wrong trail. In Java you are allowed 
to have as many package-private classes as you wish; the constraint is only 
on one *public* class. If you had ConcreteChild.java with this in it:

abstract class AbstractParent {
public final int x() { return 6; }
}

public class ConcreteChild extends AbstractParent {}

it would have compiled.

On Wednesday, March 13, 2013 12:16:10 PM UTC+1, shlomi...@gmail.com wrote:
>
> here is the bug report: http://dev.clojure.org/jira/browse/CLJ-1183
>
> Thanks!
>
> On Wednesday, March 13, 2013 1:02:25 PM UTC+2, shlomi...@gmail.com wrote:
>>
>> right, i managed to reproduce it here, thanks!
>>
>> so i am opening a bug and linking back here
>>
>> On Wednesday, March 13, 2013 12:48:43 PM UTC+2, Marko Topolnik wrote:
>>>
>>> Yes, the error is there. I also created a *lein new app* project, which 
>>> by default creates a gen-classed main namespace:
>>>
>>> (ns call-test.core (:gen-class))
>>> (set! *warn-on-reflection* true)
>>> (defn -main [& args] (.x (test.ConcreteChild.)))
>>>
>>> Now try *lein do clean, uberjar. *It will report a reflection warning 
>>> while AOT-compiling. 
>>>
>>> Then do *java -jar target/call-test-0.1.0-SNAPSHOT-standalone.jar *and 
>>> see it fail.
>>>
>>> This cleanly separates compile time from runtime.
>>>
>>> On Wednesday, March 13, 2013 11:44:05 AM UTC+1, shlomi...@gmail.comwrote:

 very interesting.. are you getting the same error as i originally got?

 On Wednesday, March 13, 2013 12:38:26 PM UTC+2, Marko Topolnik wrote:
>
> Detailed finding: it *doesn't* fail at compile time; it always fails 
> at runtime.
>
> Reason: at compile time there is a *reflection warning*, which means 
> that the method wasn't found and a reflective call was emited by the 
> compiler.
>
> On Wednesday, March 13, 2013 11:31:08 AM UTC+1, Marko Topolnik wrote:
>>
>> I did it: the method must be final. Apparently without that the child 
>> is compiled with an overriding method that I didn't even define!
>>
>> On Wednesday, March 13, 2013 11:27:55 AM UTC+1, Marko Topolnik wrote:
>>>
>>> You should first make a minimal example that reproduces this. I've 
>>> just failed to do so with the following:
>>>
>>> abstract class AbstractParent {
>>> public void x() { System.out.println("x"); }
>>> }
>>>
>>> public class ConcreteChild extends AbstractParent {
>>> }
>>>
>>> user> (set! *warn-on-reflection* true)
>>> true
>>> user> (.x (test.ConcreteChild.))
>>> nil
>>> user> (.x ^test.AbstractParent (test.ConcreteChild.))
>>> nil
>>> user> (def cc (test.ConcreteChild.))
>>> #'user/cc
>>> user> (.x cc)
>>> Reflection warning, NO_SOURCE_PATH:1:1 - reference to field x can't 
>>> be resolved.
>>> nil
>>> user> 
>>>
>>> What must I add to break 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/groups/opt_out.




Re: Java interop: "Can't call public method of non-public class"

2013-03-13 Thread shlomivaknin
oh, right. thats a good point.

ill re-post that correction on the bug report.. thanks for the review!

On Wednesday, March 13, 2013 1:42:51 PM UTC+2, Marko Topolnik wrote:
>
> Hm. You shouldn't have made ConcreteChild a nested class, that is a 
> distraction that may set people on a wrong trail. In Java you are allowed 
> to have as many package-private classes as you wish; the constraint is only 
> on one *public* class. If you had ConcreteChild.java with this in it:
>
> abstract class AbstractParent {
> public final int x() { return 6; }
> }
>
> public class ConcreteChild extends AbstractParent {}
>
> it would have compiled.
>
> On Wednesday, March 13, 2013 12:16:10 PM UTC+1, shlomi...@gmail.com wrote:
>>
>> here is the bug report: http://dev.clojure.org/jira/browse/CLJ-1183
>>
>> Thanks!
>>
>> On Wednesday, March 13, 2013 1:02:25 PM UTC+2, shlomi...@gmail.com wrote:
>>>
>>> right, i managed to reproduce it here, thanks!
>>>
>>> so i am opening a bug and linking back here
>>>
>>> On Wednesday, March 13, 2013 12:48:43 PM UTC+2, Marko Topolnik wrote:

 Yes, the error is there. I also created a *lein new app* project, 
 which by default creates a gen-classed main namespace:

 (ns call-test.core (:gen-class))
 (set! *warn-on-reflection* true)
 (defn -main [& args] (.x (test.ConcreteChild.)))

 Now try *lein do clean, uberjar. *It will report a reflection warning 
 while AOT-compiling. 

 Then do *java -jar target/call-test-0.1.0-SNAPSHOT-standalone.jar *and 
 see it fail.

 This cleanly separates compile time from runtime.

 On Wednesday, March 13, 2013 11:44:05 AM UTC+1, shlomi...@gmail.comwrote:
>
> very interesting.. are you getting the same error as i originally got?
>
> On Wednesday, March 13, 2013 12:38:26 PM UTC+2, Marko Topolnik wrote:
>>
>> Detailed finding: it *doesn't* fail at compile time; it always fails 
>> at runtime.
>>
>> Reason: at compile time there is a *reflection warning*, which means 
>> that the method wasn't found and a reflective call was emited by the 
>> compiler.
>>
>> On Wednesday, March 13, 2013 11:31:08 AM UTC+1, Marko Topolnik wrote:
>>>
>>> I did it: the method must be final. Apparently without that the 
>>> child is compiled with an overriding method that I didn't even define!
>>>
>>> On Wednesday, March 13, 2013 11:27:55 AM UTC+1, Marko Topolnik wrote:

 You should first make a minimal example that reproduces this. I've 
 just failed to do so with the following:

 abstract class AbstractParent {
 public void x() { System.out.println("x"); }
 }

 public class ConcreteChild extends AbstractParent {
 }

 user> (set! *warn-on-reflection* true)
 true
 user> (.x (test.ConcreteChild.))
 nil
 user> (.x ^test.AbstractParent (test.ConcreteChild.))
 nil
 user> (def cc (test.ConcreteChild.))
 #'user/cc
 user> (.x cc)
 Reflection warning, NO_SOURCE_PATH:1:1 - reference to field x can't 
 be resolved.
 nil
 user> 

 What must I add to break 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/groups/opt_out.




clojurescript browser repl not working.

2013-03-13 Thread Rohan Nicholls
Hey all,

I have been experimenting with clojurescript and following the modern tutorial.

However I am now stuck while trying to get the browser repl (brepl) working.

I looked on the clojurescript jira tracker and there was no mention of
this problem.  There was no way to add an issue, so I thought I would
post here as this is what is mentioned on the clojurescript page.

This issue means no brepl, which pretty much brings any further
investigation of clojurescript to a halt.

Thanks in advance for any help.

Rohan

The details:

I was following this tutorial:
https://github.com/magomimmo/modern-cljs/blob/master/doc/tutorial-02.md

I have a static web server running, I get a repl by executing:

lein trampoline cljsbuild repl-listen

And then I go to the simple.html page being served up by my server:

http://localhost:/simple.html

At this point according to the tutorial I should be good to go, and
the repl from the cljsbuild command given in the terminal earlier
should work.

However, it hangs, and so I opened the console and saw these errors.

Uncaught TypeError: Cannot call method 'call' of undefined  on line
989 of repl

Which is actually caused by:

Uncaught TypeError: Cannot read property 'client' of undefined on line
1021 of repl

The source comes from this url:
http://localhost:9000/repl?xpc=%7B%22cn%22%3A%22ScD89D6Sbo%22%2C%22tp%22%3Anull%2C%22osh%22%3Anull%2C%22ppu%22%3A%22http%3A%2F%2Flocalhost%3A3000%2Frobots.txt%22%2C%22lpu%22%3A%22http%3A%2F%2Flocalhost%3A9000%2Frobots.txt%22%7D

which after some grepping is coming from:
/repl/client.js

And sure enough if I go to the offending line I see this:


  clojure.browser.repl.client.start("http://localhost:9000";);
Uncaught TypeError: Cannot read property 'client' of undefined
  

evaluating the clojure object indeed gives us clojure.browser.repl but
the repl object has no client.

I started looking into this in more depth and found that indeed the
code that defines a client and the start function which is found one
line up:

clojure.browser.repl.client={};
clojure.browser.repl.client.start=function(a){
  return goog.events.listen(window,"load",function(){
return clojure.browser.repl.start_evaluator.call(null,a)
  })
};

The ...repl.start_evaluator exists, and looks like this:

clojure.browser.repl.start_evaluator=function(a){
var b=clojure.browser.net.xpc_connection.call(null);
if(cljs.core.truth_(b)){
var c=clojure.browser.net.xhr_connection.call(null);

clojure.browser.event.listen.call(null,c,"\ufdd0'success",function(a){
return 
clojure.browser.net.transmit.call(null,b,"\ufdd0'evaluate-javascript",a.currentTarget.getResponseText(cljs.core.List.EMPTY))
});

clojure.browser.net.register_service.call(null,b,"\ufdd0'send-result",function(b){
return 
clojure.browser.repl.send_result.call(null,c,a,clojure.browser.repl.wrap_message.call(null,"\ufdd0'result",b))
});

clojure.browser.net.register_service.call(null,b,"\ufdd0'print",function(b){
return 
clojure.browser.repl.send_print.call(null,a,clojure.browser.repl.wrap_message.call(null,"\ufdd0'print",b))
});

clojure.browser.net.connect.call(null,b,cljs.core.constantly.call(null,null));
return setTimeout(function(){
return 
clojure.browser.repl.send_result.call(null,c,a,clojure.browser.repl.wrap_message.call(null,"\ufdd0'ready","ready"))
},50)
}
return alert("No 'xpc' param provided to child iframe.")
}



There is no obvious place where this goes wrong within the
start_evaluator, as all the methods that are called, exist.  So here
is the function (prettyfied) where the error occurs.

Uncaught TypeError: Cannot call method 'call' of undefined  on line
989 of repl

clojure.browser.net.connect=function(){
var a=null,
b=function(a){
var b;
b=a?a.clojure$browser$net$IConnection$connect$arity$1:a;
if(b)
return 
a.clojure$browser$net$IConnection$connect$arity$1(a);
b=clojure.browser.net.connect[goog.typeOf(null==a?null:a)];
if(!b&&(b=clojure.browser.net.connect._,!b))
throw 
cljs.core.missing_protocol.call(null,"IConnection.connect",a);
return b.call(null,a)
},
c=function(a,b){
var c;
c=a?a.clojure$browser$net$IConnection$connect$arity$2:a;
if(c)
return 
a.clojure$browser$net$IConnection$connect$arity$2(a,b);
c=clojure.browser.net.connect[goog.typeOf(null==a?null:a)];
if(!c&&(c=clojure.browser.net.connect._,!c))
throw 
cljs.core.missing_proto

Re: Clojure HTML5 Game Development

2013-03-13 Thread Laurent PETIT
2013/3/13 Mikera 

> On Wednesday, 13 March 2013 04:34:21 UTC+8, Reginald Choudari wrote:
>
>> Any resources/people dedicated to game development using
>> Clojure/Clojurescript?
>> I have made a couple games using HTML5/Javascript with the canvas
>> element, and seeing that Clojurescript can replace Javascript coupled with
>> Clojure hosting an HTTP web server, I was thinking of moving over to the
>> Clojure way of coding things.. Any suggestions?
>>
>
> You might want to take a look at using LibGDX: I've heard good things
> about it and will probably give it a go for my next game project:
>
> http://libgdx.badlogicgames.com/
>
> Apparently a few folks are using it to write android games in Clojure, but
> it should also be fully cross-platform (e.g. desktop / web as well)
>

Probably not for the web. The landing page states that it does web via GWT,
which is a technology that compiles java source code to javascript ...


>  --
> --
> 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/groups/opt_out.
>
>
>

-- 
-- 
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/groups/opt_out.




Re: Java interop with dynamic proxies

2013-03-13 Thread Thomas
Not sure what I did previously different, but now it seems to work for me 
with the code snippet similar as the one above (And which I am sure I tried 
before as well).

Thank you all for your help,

Thomas

-- 
-- 
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/groups/opt_out.




Re: fold over a sequence

2013-03-13 Thread Paul Butcher
Thanks Stuart - my Contributor Agreement is on its way.

In the meantime, I've published foldable-seq as a library:

https://clojars.org/foldable-seq

I'd be very interested in any feedback on the code or how it works. 

--
paul.butcher->msgCount++

Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: p...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher

On 12 Mar 2013, at 21:48, Stuart Sierra  wrote:

> See clojure.org/contributing 
> 
> it's all there.
> 
> On Tuesday, March 12, 2013, Paul Butcher wrote:
> On 12 Mar 2013, at 18:26, Stuart Sierra  wrote:
> 
>> This might be an interesting contribution to clojure.core.reducers. I 
>> haven't looked at your code in detail, so I can't say for sure, but being 
>> able to do parallel fold over semi-lazy sequences would be very useful.
> 
> I'd be delighted if this (or something like it) could make it into 
> clojure.core.reducers, Stuart. What would I need to do to make this happen?
> 
> --
> paul.butcher->msgCount++
> 
> Snetterton, Castle Combe, Cadwell Park...
> Who says I have a one track mind?
> 
> http://www.paulbutcher.com/
> LinkedIn: http://www.linkedin.com/in/paulbutcher
> MSN: p...@paulbutcher.com
> AIM: paulrabutcher
> Skype: paulrabutcher
> 
> 
> -- 
> -- 
> 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 a topic in the Google 
> Groups "Clojure" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/clojure/8RKCjF00ukQ/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to 
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  
> 
> -- 
> -- 
> 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/groups/opt_out.
>  
>  

-- 
-- 
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/groups/opt_out.




Re: fold over a sequence

2013-03-13 Thread Jim foo.bar

how come your project depends on the problematic version 1.5.0?

Jim

On 13/03/13 14:03, Paul Butcher wrote:

Thanks Stuart - my Contributor Agreement is on its way.

In the meantime, I've published foldable-seq as a library:

https://clojars.org/foldable-seq

I'd be very interested in any feedback on the code or how it works.

--
paul.butcher->msgCount++

Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?

http://www.paulbutcher.com /
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: p...@paulbutcher.com 
AIM: paulrabutcher
Skype: paulrabutcher

On 12 Mar 2013, at 21:48, Stuart Sierra > wrote:



See clojure.org/contributing 

it's all there.

On Tuesday, March 12, 2013, Paul Butcher wrote:

On 12 Mar 2013, at 18:26, Stuart Sierra
> wrote:


This might be an interesting contribution to
clojure.core.reducers. I haven't looked at your code in detail,
so I can't say for sure, but being able to do parallel fold over
semi-lazy sequences would be very useful.


I'd be delighted if this (or something like it) could make it
into clojure.core.reducers, Stuart. What would I need to do to
make this happen?

--
paul.butcher->msgCount++

Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?

http://www.paulbutcher.com /
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: p...@paulbutcher.com 
AIM: paulrabutcher
Skype: paulrabutcher


-- 
-- 
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 a topic
in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/clojure/8RKCjF00ukQ/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email
to clojure+unsubscr...@googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out.



--
--
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/groups/opt_out.




--
--
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/groups/opt_out.




--
--
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/groups/opt_out.




Re: fold over a sequence

2013-03-13 Thread Paul Butcher
On 13 Mar 2013, at 14:05, "Jim foo.bar"  wrote:

> how come your project depends on the problematic version 1.5.0?

1.5.0 is problematic?

--
paul.butcher->msgCount++

Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: p...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher

-- 
-- 
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/groups/opt_out.




Re: fold over a sequence

2013-03-13 Thread Jim foo.bar

there was a memory leak hence the 1.5.1 release the next day...

Jim

On 13/03/13 14:12, Paul Butcher wrote:
On 13 Mar 2013, at 14:05, "Jim foo.bar" > wrote:



how come your project depends on the problematic version 1.5.0?


1.5.0 is problematic?

--
paul.butcher->msgCount++

Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: p...@paulbutcher.com 
AIM: paulrabutcher
Skype: paulrabutcher

--
--
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/groups/opt_out.




--
--
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/groups/opt_out.




Re: fold over a sequence

2013-03-13 Thread Paul Butcher
Ah - sorry, missed that. I've just released version 0.2, which depends on 1.5.1.

--
paul.butcher->msgCount++

Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: p...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher

On 13 Mar 2013, at 14:13, Jim foo.bar  wrote:

> there was a memory leak hence the 1.5.1 release the next day...
> 
> Jim
> 
> On 13/03/13 14:12, Paul Butcher wrote:
>> On 13 Mar 2013, at 14:05, "Jim foo.bar"  wrote:
>> 
>>> how come your project depends on the problematic version 1.5.0?
>> 
>> 1.5.0 is problematic?
>> 
>> --
>> paul.butcher->msgCount++
>> 
>> Snetterton, Castle Combe, Cadwell Park...
>> Who says I have a one track mind?
>> 
>> http://www.paulbutcher.com/
>> LinkedIn: http://www.linkedin.com/in/paulbutcher
>> MSN: p...@paulbutcher.com
>> AIM: paulrabutcher
>> Skype: paulrabutcher
>> 
>> -- 
>> -- 
>> 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/groups/opt_out.
>>  
>>  
> 
> 
> -- 
> -- 
> 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/groups/opt_out.
>  
>  

-- 
-- 
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/groups/opt_out.




Re: What causes the text that I print to the terminal to become mangled garbage?

2013-03-13 Thread larry google groups

Thanks all. I don't think this can be just a concurrency issue or I would 
also see it when I'm not using Timbre. If I call pprint from multiple 
threads I don't get this kind of interleaving of individual characters. Nor 
do I normally get this interleaving when just using Timbre. But somehow the 
combination of thread-measuring functions and Timbre set off some 
fireworks. 

Maybe I'll dig into this when I have more time. For now I've switched to 
simple println (rather than Timbre) statements for the thread-measuring 
stuff. 

 



On Wednesday, March 13, 2013 4:02:59 AM UTC-4, Marko Topolnik wrote:
>
> There *is* mutual exclusion on all Java output streams (as well as input 
> streams) so at least individual prints should be atomic. Not that it will 
> solve this, but still, this kind of granularity of interleaving is unusual. 
> I have never seen it.
>
> On Wednesday, March 13, 2013 4:27:00 AM UTC+1, Michael Klishin wrote:
>>
>> 2013/3/13 larry google groups 
>>
>>> At least some of this mangled text is coming from this function, which 
>>> is called at startup and then runs in its own thread
>>
>>
>> If your app itself prints stuff to stdout/stderr, it is likely to be 
>> interleaved with the output from the spying thread.
>> Thread execution order and time slicing is non-deterministic and nothing 
>> synchronizes writing to stdout/stderr
>> to enforce ordering.
>> -- 
>> MK
>>
>> http://github.com/michaelklishin
>> http://twitter.com/michaelklishin
>>  
>

-- 
-- 
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/groups/opt_out.




Re: What causes the text that I print to the terminal to become mangled garbage?

2013-03-13 Thread larry google groups
> tl;dr concurrency is hard
 
Jason, if it was just a concurrency issue, it would happen when I use 
pprint. But the above mess only seems to happen with a very specific 
combination of Timbre and thread measuring functions. 






On Wednesday, March 13, 2013 12:16:46 AM UTC-4, Jason Lewis wrote:
>
> tl;dr concurrency is hard
>
> Jason Lewis
>
> Email  jasonl...@gmail.com  
>
> Twitter@canweriotnow 
>
> Blog   http://decomplecting.org
>
> About http://about.me/jason.lewis
>
>
> On Tue, Mar 12, 2013 at 11:27 PM, Michael Klishin 
> 
> > wrote:
>
>> 2013/3/13 larry google groups >
>>
>>> At least some of this mangled text is coming from this function, which 
>>> is called at startup and then runs in its own thread
>>
>>
>> If your app itself prints stuff to stdout/stderr, it is likely to be 
>> interleaved with the output from the spying thread.
>> Thread execution order and time slicing is non-deterministic and nothing 
>> synchronizes writing to stdout/stderr
>> to enforce ordering.
>> -- 
>> MK
>>
>> http://github.com/michaelklishin
>> http://twitter.com/michaelklishin
>>  
>> -- 
>> -- 
>> 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/groups/opt_out.
>>  
>>  
>>
>
>

-- 
-- 
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/groups/opt_out.




Re: What's the point of -> ?

2013-03-13 Thread larry google groups
> I suspect that early on, still being a Clojure noobie, I'll stick with 
the 'proper' 
> Lisp forms and no doubt as I become more experienced I'll pick more 
> of the arcane Clojure idioms ;)


I agree. I have been working with Clojure for almost 8 months now. I am 
sort of in between "new" and "medium" in terms of getting used to it. I 
still find the "->" macro hard to read. I mentally have to translate it 
back to normal Clojure to figure out what is going on. 





On Monday, March 11, 2013 11:00:13 AM UTC-4, edw...@kenworthy.info wrote:
>
> But to understand the first you have to expand it into the second- which 
> means understanding the arcane squiggle -> and how it differs from the 
> equally arcane squiggle ->>. Nasty, sticky, syntactic sugar :)
>
> I suspect that early on, still being a Clojure noobie, I'll stick with the 
> 'proper' Lisp forms and no doubt as I become more experienced I'll pick 
> more of the arcane Clojure idioms ;)
>
> On Monday, March 11, 2013 10:58:29 AM UTC, edw...@kenworthy.info wrote:
>>
>> So I understand that:
>>
>> (-> foo bar wibble)
>>
>> is equivalent to
>>
>> (wibble (bar (foo)))
>>
>> With the advantage that the latter version is better, in the sense that 
>> it's clearer what the final result is (the result of the call to wobble).
>>
>> What I don't understand is the need for -> the only thing it seems to do 
>> is make something Lispy appear to be imperative.
>>
>> Is that 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/groups/opt_out.




Re: What causes the text that I print to the terminal to become mangled garbage?

2013-03-13 Thread David Powell
pprint uses refs internally rather than vars.  I was always a bit
suspicious about that...  Perhaps transaction retries are happening?


On Wed, Mar 13, 2013 at 3:19 PM, larry google groups <
lawrencecloj...@gmail.com> wrote:

> > tl;dr concurrency is hard
>
> Jason, if it was just a concurrency issue, it would happen when I use
> pprint. But the above mess only seems to happen with a very specific
> combination of Timbre and thread measuring functions.
>
>
>
>
>
>
> On Wednesday, March 13, 2013 12:16:46 AM UTC-4, Jason Lewis wrote:
>
>> tl;dr concurrency is hard
>>
>> Jason Lewis
>>
>> Email  jasonl...@gmail.com
>>
>> Twitter@canweriotnow 
>>
>> Blog   http://decomplecting.org
>>
>> About http://about.me/jason.lewis
>>
>>
>> On Tue, Mar 12, 2013 at 11:27 PM, Michael Klishin 
>> wrote:
>>
>>> 2013/3/13 larry google groups 
>>>
>>>  At least some of this mangled text is coming from this function, which
 is called at startup and then runs in its own thread
>>>
>>>
>>> If your app itself prints stuff to stdout/stderr, it is likely to be
>>> interleaved with the output from the spying thread.
>>> Thread execution order and time slicing is non-deterministic and nothing
>>> synchronizes writing to stdout/stderr
>>> to enforce ordering.
>>> --
>>> MK
>>>
>>> http://github.com/**michaelklishin 
>>> http://twitter.com/**michaelklishin 
>>>
>>> --
>>> --
>>> 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/**groups/opt_out
>>> .
>>>
>>>
>>>
>>
>>  --
> --
> 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/groups/opt_out.
>
>
>

-- 
-- 
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/groups/opt_out.




ANN: core.logic 0.8.0-rc3

2013-03-13 Thread David Nolen
This is probably the last version before I cut 0.8.0. If you're using
core.logic please try this out. There are a couple of bugs that need
squashing in JIRA but it's been nearly 8 months since the last release so
I'd like to push this out now and address any issues with more incremental
updates.

Changes: http://github.com/clojure/core.logic/blob/master/CHANGES.md

David

-- 
-- 
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/groups/opt_out.




Re: [ANN] jvm.tools.analyzer / clr.tools.analyzer

2013-03-13 Thread Rich Morin
On Mar 13, 2013, at 09:21, Ambrose Bonnaire-Sergeant wrote:
> I have two recently created contrib projects to help use analysis
> results for Clojure and ClojureCLR.

Have you considered whether an how this information could be used
as part of Codeq's analysis phase?  For example, how hard would it
be to relate the AST to specific line and column numbers?

-r

 -- 
http://www.cfcl.com/rdmRich Morin
http://www.cfcl.com/rdm/resume r...@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Software system design, development, and documentation


-- 
-- 
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/groups/opt_out.




Re: [ANN] jvm.tools.analyzer / clr.tools.analyzer

2013-03-13 Thread Ambrose Bonnaire-Sergeant
How useful is a fully macroexpanded AST to Codeq? There are line numbers
associated
with the AST nodes, and column numbers if you're using Clojure 1.5.0+.

Ambrose

On Thu, Mar 14, 2013 at 12:48 AM, Rich Morin  wrote:

> On Mar 13, 2013, at 09:21, Ambrose Bonnaire-Sergeant wrote:
> > I have two recently created contrib projects to help use analysis
> > results for Clojure and ClojureCLR.
>
> Have you considered whether an how this information could be used
> as part of Codeq's analysis phase?  For example, how hard would it
> be to relate the AST to specific line and column numbers?
>
> -r
>
>  --
> http://www.cfcl.com/rdmRich Morin
> http://www.cfcl.com/rdm/resume r...@cfcl.com
> http://www.cfcl.com/rdm/weblog +1 650-873-7841
>
> Software system design, development, and documentation
>
>
> --
> --
> 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/groups/opt_out.
>
>
>

-- 
-- 
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/groups/opt_out.




Is it possible to set breakpoint using nrepl-ritz?

2013-03-13 Thread xumingming64398966
Is it possible to set breakpoint using nrepl-ritz?



-- 
-- 
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/groups/opt_out.
 
 


回复:Is it possible to set breakpoint using nrepl-ritz?

2013-03-13 Thread xumingming64398966
I mean ritz-nrepl: https://github.com/pallet/ritz/tree/develop/nrepl 原始邮件 发件人: xumingming64398966收件人: clojure发送时间: 2013年3月14日(周四) 01:00主题: Is it possible to set breakpoint using nrepl-ritz?Is it possible to set breakpoint using nrepl-ritz?



-- 
-- 
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/groups/opt_out.
 
 


Re: [ANN] jvm.tools.analyzer / clr.tools.analyzer

2013-03-13 Thread Rich Morin
On Mar 13, 2013, at 09:52, Ambrose Bonnaire-Sergeant wrote:
> How useful is a fully macroexpanded AST to Codeq?

Let's decomplect this question a bit, eg:

*  How useful is an AST to Codeq?

Rich Hickey's Clojure analyzer only harvests def* and ns forms.
So, for example, it says nothing about symbols used in a defn.

An AST could add a lot of information to the database, but I'm
not at all sure which facts would be useful.  That said, I'd
be inclined to err on the side of having too many facts, at
least for early experimentation.

*  How does macro expansion affect the utility?

Just as it might be interesting to know what symbols a defn
uses, it might be useful to know what macros it calls.

> There are line numbers associated with the AST nodes, and
> column numbers if you're using Clojure 1.5.0+.

How do these line and column numbers relate to the original
code?  For example, how doe macro expansion affect them?

-r

 -- 
http://www.cfcl.com/rdmRich Morin
http://www.cfcl.com/rdm/resume r...@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Software system design, development, and documentation


-- 
-- 
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/groups/opt_out.




Re: Is it possible to set breakpoint using nrepl-ritz?

2013-03-13 Thread Hugo Duncan
"xumingming64398966" writes:

> Is it possible to set breakpoint using nrepl-ritz?

It is using the latest development code (C-c C-x C-b on the line to
break at).  A release should be out containing this in the next few
days.

Hugo

-- 
-- 
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/groups/opt_out.




Re: ClojureCLR - Question about the "Debug 3.5" build configuration and "System.Reflection.Assembly.IsDynamic" property

2013-03-13 Thread dmiller
Oops. Forgot to do a test build on 3.5 for that one.  I need to 
conditionalize that call.
I'll try to commit a patch for that tonight.

-David


On Tuesday, March 12, 2013 11:43:58 PM UTC-5, FC wrote:
>
> Hi,
>
> I'm trying to build ClojureCLR from the latest clojure-clr-master.ZIP file 
> I downloaded from GitHub. 
>
> With "Debug 3.5" as the build configuration I get a compilation error in 
> Clojure\lib\RT.cs that "System.Reflection.Assembly does not contain a 
> definition for 'IsDynamic'".
>
> Is this expected? When I use "Debug 4.0" it builds fine.
>
> Thank you.
>
> -Fiel
>

-- 
-- 
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/groups/opt_out.




set!

2013-03-13 Thread Mark Engelberg
In Clojure, there are a handful of global variables that you can set!, for
example
(set! *warn-on-reflection* true)

Is there any mechanism for providing a similar feature in a user library?

-- 
-- 
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/groups/opt_out.




ANN Clojure documentation progress report for March 13th, 2013

2013-03-13 Thread Michael Klishin
The Clojure Documentation Site [1] (a.k.a. CDS) publishes
periodic reports to give the Clojure community a better idea of
what it has to offer.

Our progress report for March 13th, 2013:
http://blog.clojurewerkz.org/blog/2013/03/13/clojure-documentation-project-progress-report-march-13th/

1. http://clojure-doc.org
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
-- 
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/groups/opt_out.




Re: [ANN] jvm.tools.analyzer / clr.tools.analyzer

2013-03-13 Thread kovas boguta
On Wed, Mar 13, 2013 at 9:52 AM, Ambrose Bonnaire-Sergeant
 wrote:
> How useful is a fully macroexpanded AST to Codeq? There are line numbers
> associated
> with the AST nodes, and column numbers if you're using Clojure 1.5.0+.

I am strongly of the opinion that macroexpansion should not be part of
a codeq's core definition.

First off, it is not the minimal thing we need to get useful
dependency analysis done. What we really need is the
non-macro-expanded sub-codeqs.

Also, it's just a huge can of worms. You would need a new hashing
function that would be invariant to gen-sym suffixes. More
importantly, where do you draw the line when there is recursive
subexpansion of nested macros? Do capture the whole evaluation tree?
And how do you relate that back to the original code? Capturing only
some of the dependencies would seem to miss the point.

Interesting questions, but we shouldn't let them hold up the basic steps.

> Ambrose
>
>
> On Thu, Mar 14, 2013 at 12:48 AM, Rich Morin  wrote:
>>
>> On Mar 13, 2013, at 09:21, Ambrose Bonnaire-Sergeant wrote:
>> > I have two recently created contrib projects to help use analysis
>> > results for Clojure and ClojureCLR.
>>
>> Have you considered whether an how this information could be used
>> as part of Codeq's analysis phase?  For example, how hard would it
>> be to relate the AST to specific line and column numbers?
>>
>> -r
>>
>>  --
>> http://www.cfcl.com/rdmRich Morin
>> http://www.cfcl.com/rdm/resume r...@cfcl.com
>> http://www.cfcl.com/rdm/weblog +1 650-873-7841
>>
>> Software system design, development, and documentation
>>
>>
>> --
>> --
>> 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/groups/opt_out.
>>
>>
>
> --
> --
> 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/groups/opt_out.
>
>

-- 
-- 
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/groups/opt_out.




Re: What's the point of -> ?

2013-03-13 Thread Denis Labaye
I find the threading macros expressions much easier to *write* and *edit*
than their nested expression counterparts.

And it comes very handy when working at the REPL, to incrementally build an
expression.

It's easier to toggle on / off some parts of the pipeline than it is for a
nested expression:

(a (b (c (d (e X)


oops `d` *may* be wrong, let's try to turn it off:

mmm ... will require a lot of keyboard clicks and paredit magic

On the other hand:

(-> X
e
d
c
b
a)


Turning off `d`:

(-> X
e
#_d
c
b
a)


or even `d` and `b`:

(-> X
e
#_d
c
#_b
a)


piece of cake.

Same goes on for inserting a new expression in a pipeline, pprinting, ...



On Mon, Mar 11, 2013 at 11:58 AM,  wrote:

> So I understand that:
>
> (-> foo bar wibble)
>
> is equivalent to
>
> (wibble (bar (foo)))
>
> With the advantage that the latter version is better, in the sense that
> it's clearer what the final result is (the result of the call to wobble).
>
> What I don't understand is the need for -> the only thing it seems to do
> is make something Lispy appear to be imperative.
>
> Is that 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/groups/opt_out.
>
>
>

-- 
-- 
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/groups/opt_out.




Re: [ANN] jvm.tools.analyzer / clr.tools.analyzer

2013-03-13 Thread Rich Morin
On Mar 13, 2013, at 13:05, kovas boguta wrote:
> On Wed, Mar 13, 2013 at 9:52 AM, Ambrose Bonnaire-Sergeant wrote:
>> How useful is a fully macroexpanded AST to Codeq?  ...
> 
> I am strongly of the opinion that macroexpansion should not be part of
> a codeq's core definition.  ...


I agree, for your reasons and others.  For example, I don't think a codeq
should say much about _any_ symbol the code references.

However, that seems to create a disconnect.  If codeq is tracking raw code,
and the AST reflects expanded code, (how) can the two be reconciled?

-r

 -- 
http://www.cfcl.com/rdmRich Morin
http://www.cfcl.com/rdm/resume r...@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Software system design, development, and documentation


-- 
-- 
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/groups/opt_out.




Re: set!

2013-03-13 Thread Mark Engelberg
OK, thanks.  The apparent "globalness" is not the piece I want to imitate.
I want to make a var available for users to set!, where the var controls
overall behavior of how the library operates.

I understand that I can just declare the var dynamic, and then they can
control it with the binding construct, but I want users to be able to set!
it once and forget about it.

I believe one can mimic the functionality with alter-var-root! (I haven't
tried it though), but I'd rather imitate core's style of using set! for
those sorts of overall controlling variables.

I'm generally of the philosophy that ideally, a language should make
available for users any features it uses in its own built-in libraries, so
I'm hoping there's a way to do it.

On Wed, Mar 13, 2013 at 12:06 PM, Michael Klishin <
michael.s.klis...@gmail.com> wrote:

> 2013/3/13 Mark Engelberg 
>
>> In Clojure, there are a handful of global variables that you can set!
>
>
> They are not global, they reside in clojure.core which is referred to
> automatically.
>
> user=> *warn-on-reflection*
> false
> user=> clojure.core/*warn-on-reflection*
> false
> --
> MK
>
> http://github.com/michaelklishin
> http://twitter.com/michaelklishin
>
> --
> --
> 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/groups/opt_out.
>
>
>

-- 
-- 
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/groups/opt_out.




miniKanren / core.logic Google Group

2013-03-13 Thread David Nolen
William Byrd has started a new miniKanren / core.logic Google Group. Feel
free to direct your relational and constraint logic programming queries
there.

It's fine to post on the Clojure lists of course especially if the inquiry
/ discussion is Clojure-centric, but I'm excited about the
cross-pollination of ideas.

http://groups.google.com/forum/?fromgroups=#!forum/minikanren

David

-- 
-- 
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/groups/opt_out.




Re: set!

2013-03-13 Thread Marko Topolnik
On Wednesday, March 13, 2013 9:35:42 PM UTC+1, puzzler wrote:

> OK, thanks.  The apparent "globalness" is not the piece I want to 
> imitate.  I want to make a var available for users to set!, where the var 
> controls overall behavior of how the library operates.
>
> I understand that I can just declare the var dynamic, and then they can 
> control it with the binding construct, but I want users to be able to set! 
> it once and forget about it.
>

As far as I understand it, *set!* modifies the *thread-local* binding, just 
like the *binding* macro, but doesn't delimit a definite scope of validity 
for the binding. You can *set!* any dynamic var with the same semantics.

-Marko
 

-- 
-- 
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/groups/opt_out.




Re: [ANN] jvm.tools.analyzer / clr.tools.analyzer

2013-03-13 Thread kovas boguta
On Wed, Mar 13, 2013 at 1:27 PM, Rich Morin  wrote:

> I agree, for your reasons and others.  For example, I don't think a codeq
> should say much about _any_ symbol the code references.
>
> However, that seems to create a disconnect.  If codeq is tracking raw code,
> and the AST reflects expanded code, (how) can the two be reconciled?

I'm going to expose my own ignorance here.

Isn't it necessary to generate an AST *before* macro-expansion? How
else are the macros executed?

Or is macro-expansion performed in the bowels of the compiler, in an
interpreted manner?

If anyone has pointers to a blog post or talk on this, I'd appreciate it. Thanks


>
> -r
>
>  --
> http://www.cfcl.com/rdmRich Morin
> http://www.cfcl.com/rdm/resume r...@cfcl.com
> http://www.cfcl.com/rdm/weblog +1 650-873-7841
>
> Software system design, development, and documentation
>
>
> --
> --
> 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/groups/opt_out.
>
>

-- 
-- 
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/groups/opt_out.




Re: set!

2013-03-13 Thread Cedric Greevey
To expand on what Marko said, the set!able Vars that come with Clojure just
have thread-local bindings created already in the REPL thread. They're
really only meant to aid developers working at the REPL, rather than to be
set! as part of normal running code.


On Wed, Mar 13, 2013 at 5:06 PM, Marko Topolnik wrote:

> On Wednesday, March 13, 2013 9:35:42 PM UTC+1, puzzler wrote:
>
>> OK, thanks.  The apparent "globalness" is not the piece I want to
>> imitate.  I want to make a var available for users to set!, where the var
>> controls overall behavior of how the library operates.
>>
>> I understand that I can just declare the var dynamic, and then they can
>> control it with the binding construct, but I want users to be able to set!
>> it once and forget about it.
>>
>
> As far as I understand it, *set!* modifies the *thread-local* binding,
> just like the *binding* macro, but doesn't delimit a definite scope of
> validity for the binding. You can *set!* any dynamic var with the same
> semantics.
>
> -Marko
>
>
> --
> --
> 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/groups/opt_out.
>
>
>

-- 
-- 
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/groups/opt_out.




skip null

2013-03-13 Thread Brian Craft
Is there a common idiom for skipping blank or null values, as you might do 
in javascript like
var foo = a || b || c;


-- 
-- 
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/groups/opt_out.




Re: skip null

2013-03-13 Thread Marko Topolnik
There are several, depending on what exactly you want to skip. Your example 
would just be

(let [foo (or a b c)] ...)

There are also some-> and cond->, which you may find useful in other 
contexts.

On Wednesday, March 13, 2013 10:31:33 PM UTC+1, Brian Craft wrote:
>
> Is there a common idiom for skipping blank or null values, as you might do 
> in javascript like
> var foo = a || b || c;
>
>
>

-- 
-- 
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/groups/opt_out.




Re: set!

2013-03-13 Thread Michael Klishin
2013/3/14 Mark Engelberg 

> I believe one can mimic the functionality with alter-var-root! (I haven't
> tried it though), but I'd rather imitate core's style of using set! for
> those sorts of overall controlling variables.


alter-var-root works fine for that purpose, e.g.
https://github.com/michaelklishin/monger/blob/master/src/clojure/monger/core.clj#L168-171

-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

-- 
-- 
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/groups/opt_out.




Re: set!

2013-03-13 Thread Mark Engelberg
On Wed, Mar 13, 2013 at 2:09 PM, Cedric Greevey  wrote:

> To expand on what Marko said, the set!able Vars that come with Clojure
> just have thread-local bindings created already in the REPL thread. They're
> really only meant to aid developers working at the REPL, rather than to be
> set! as part of normal running code.
>
>
Well, there are things like *unchecked-math* which seem like they are
intended for uses other than working at the REPL.

-- 
-- 
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/groups/opt_out.




Re: [ANN] jvm.tools.analyzer / clr.tools.analyzer

2013-03-13 Thread Rich Morin
On Mar 13, 2013, at 14:08, kovas boguta wrote:
> On Wed, Mar 13, 2013 at 1:27 PM, Rich Morin  wrote:
> 
>> I agree, for your reasons and others.  For example, I don't think a codeq
>> should say much about _any_ symbol the code references.
>> 
>> However, that seems to create a disconnect.  If codeq is tracking raw code,
>> and the AST reflects expanded code, (how) can the two be reconciled?
> 
> I'm going to expose my own ignorance here.
> 
> Isn't it necessary to generate an AST *before* macro-expansion? How
> else are the macros executed?
> 
> Or is macro-expansion performed in the bowels of the compiler, in an
> interpreted manner?
> 
> If anyone has pointers to a blog post or talk on this, I'd appreciate it.

This page (comments and corrections welcome!) which tries to explain this:

  http://wiki.cfcl.com/bin/view/Projects/Clojure/Key/Architecture

The page is largely based on my understanding of Rich Hickey's video:

  Clojure for Java Programmers
  http://www.youtube.com/watch?v=P76Vbsk_3J0
  (especially the sections on Syntax and Evaluation, starting at 0:46:50)

-r

 -- 
http://www.cfcl.com/rdmRich Morin
http://www.cfcl.com/rdm/resume r...@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Software system design, development, and documentation


-- 
-- 
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/groups/opt_out.




Re: set!

2013-03-13 Thread Mark Engelberg
On Wed, Mar 13, 2013 at 2:06 PM, Marko Topolnik wrote:


> As far as I understand it, *set!* modifies the *thread-local* binding,
> just like the *binding* macro, but doesn't delimit a definite scope of
> validity for the binding. You can *set!* any dynamic var with the same
> semantics.
>

You can't just set! any dynamic var, you can only set! vars that are both
dynamic *and* have been bound again with the binding construct.

=> (def ^:dynamic a 2)
#'user/a
=> (set! a 3)
IllegalStateException Can't change/establish root binding of: a with set
clojure.lang.Var.set (Var.java:233)
=> (binding [a 1] (set! a 3))
3


This is why I'm puzzled about how things like (set! *unchecked-math* true)
are handled.  Clearly, in this special case you can use set! without first
calling binding.

-- 
-- 
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/groups/opt_out.




Re: set!

2013-03-13 Thread Mark Engelberg
On Wed, Mar 13, 2013 at 2:36 PM, Michael Klishin <
michael.s.klis...@gmail.com> wrote:

> alter-var-root works fine for that purpose, e.g.
>
> https://github.com/michaelklishin/monger/blob/master/src/clojure/monger/core.clj#L168-171
>

Thanks.  That's probably what I'll end up doing.  Still, it would be nice
to understand whether it's possible to achieve the same effect as Clojure
core's settable vars.

-- 
-- 
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/groups/opt_out.




Re: set!

2013-03-13 Thread Cedric Greevey
Again, those are already given bindings. Think of it as if somewhere
there's (binding [*unchecked-math* false] (loop [] (do-repl-stuff!)
(recur))).

As for "intended for uses other than working at the REPL", they still tend
to be compile/macroexpansion-time uses, and presumably dynamic bindings
exist in the threads that compilation and macroexpansion take place on.


On Wed, Mar 13, 2013 at 5:46 PM, Mark Engelberg wrote:

> On Wed, Mar 13, 2013 at 2:06 PM, Marko Topolnik 
> wrote:
>
>
>> As far as I understand it, *set!* modifies the *thread-local* binding,
>> just like the *binding* macro, but doesn't delimit a definite scope of
>> validity for the binding. You can *set!* any dynamic var with the same
>> semantics.
>>
>
> You can't just set! any dynamic var, you can only set! vars that are both
> dynamic *and* have been bound again with the binding construct.
>
> => (def ^:dynamic a 2)
> #'user/a
> => (set! a 3)
> IllegalStateException Can't change/establish root binding of: a with set
> clojure.lang.Var.set (Var.java:233)
> => (binding [a 1] (set! a 3))
> 3
>
>
> This is why I'm puzzled about how things like (set! *unchecked-math* true)
> are handled.  Clearly, in this special case you can use set! without first
> calling binding.
>
> --
> --
> 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/groups/opt_out.
>
>
>

-- 
-- 
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/groups/opt_out.




Re: skip null

2013-03-13 Thread Brian Craft
Thanks!

On Wednesday, March 13, 2013 2:34:25 PM UTC-7, Michael Klishin wrote:
>
>
> 2013/3/14 Brian Craft >
>
>> Is there a common idiom for skipping blank or null values, as you might 
>> do in javascript like
>> var foo = a || b || c;
>>
>
> (or a b c)
>
> false and nil evaluate to false in Clojure, everything else evaluates to 
> true.
> -- 
> MK
>
> http://github.com/michaelklishin
> http://twitter.com/michaelklishin
>  

-- 
-- 
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/groups/opt_out.




Re: set!

2013-03-13 Thread Marko Topolnik
Yes, I'd say there is no low-level magic about those vars except that they 
are well-supported in all the relevant contexts. However, the fact that 
they need such special support does make it hard to use one's own vars in 
the same way.

On Wednesday, March 13, 2013 10:52:15 PM UTC+1, Cedric Greevey wrote:
>
> Again, those are already given bindings. Think of it as if somewhere 
> there's (binding [*unchecked-math* false] (loop [] (do-repl-stuff!) 
> (recur))).
>
> As for "intended for uses other than working at the REPL", they still tend 
> to be compile/macroexpansion-time uses, and presumably dynamic bindings 
> exist in the threads that compilation and macroexpansion take place on.
>
>
> On Wed, Mar 13, 2013 at 5:46 PM, Mark Engelberg 
> 
> > wrote:
>
>> On Wed, Mar 13, 2013 at 2:06 PM, Marko Topolnik 
>> 
>> > wrote:
>>
>>
>>> As far as I understand it, *set!* modifies the *thread-local* binding, 
>>> just like the *binding* macro, but doesn't delimit a definite scope of 
>>> validity for the binding. You can *set!* any dynamic var with the same 
>>> semantics.
>>>
>>
>> You can't just set! any dynamic var, you can only set! vars that are both 
>> dynamic *and* have been bound again with the binding construct.
>>
>> => (def ^:dynamic a 2)
>> #'user/a
>> => (set! a 3)
>> IllegalStateException Can't change/establish root binding of: a with set  
>> clojure.lang.Var.set (Var.java:233)
>> => (binding [a 1] (set! a 3))
>> 3
>>
>>
>> This is why I'm puzzled about how things like (set! *unchecked-math* 
>> true) are handled.  Clearly, in this special case you can use set! without 
>> first calling binding.
>>  
>> -- 
>> -- 
>> 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/groups/opt_out.
>>  
>>  
>>
>
>

-- 
-- 
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/groups/opt_out.




Re: problem with dependencies

2013-03-13 Thread BJG145
If you look for "mortbay" on this page there seems to be some discussion on 
it which may possibly shed some light on the problem...?

http://clojure-log.n01se.net/date/2012-06-12.html

-- 
-- 
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/groups/opt_out.




Re: What's the point of -> ?

2013-03-13 Thread Sean Corfield
On Wed, Mar 13, 2013 at 1:11 AM, Meikel Brandmeyer (kotarak)
 wrote:
> In my experience having problems with switching between -> and ->> is
> closely related to unknowingly  cross borders between collections land and
> sequence land. If you run into this quite often you might want to review
> your pipeline and check whether sequences are really what you want.

... which made me realize my original code could (should!) be:

(->> response :body :postalCodes
 (map to-location) (sort-by :city))

Thank you!
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
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/groups/opt_out.




Re: What's the point of -> ?

2013-03-13 Thread Laurent PETIT
2013/3/13 Sean Corfield :
> On Wed, Mar 13, 2013 at 1:11 AM, Meikel Brandmeyer (kotarak)
>  wrote:
>> In my experience having problems with switching between -> and ->> is
>> closely related to unknowingly  cross borders between collections land and
>> sequence land. If you run into this quite often you might want to review
>> your pipeline and check whether sequences are really what you want.
>
> ... which made me realize my original code could (should!) be:
>
> (->> response :body :postalCodes
>  (map to-location) (sort-by :city))

didn't notice, lol

-- 
-- 
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/groups/opt_out.




Re: skip null

2013-03-13 Thread Herwig Hochleitner
if-let and when-let also come in handy in a lot of those cases.

If the nils already are in a data structure, there are (filter
identity ..)and (remove
nil? ..) to remove false and/or nil values from sequences.
On associatives, there is an :or key available in the destructuring dsl: (let
[{x :foo :or {x "default"}} m] ..)
and you can use the the default parameter of lookups like (:foo m
"default") (get m :foo "default").
Beware that in the latter two, the default is evaluated, even if the key is
found.

-- 
-- 
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/groups/opt_out.




Re: set!

2013-03-13 Thread Alan Malloy
On Wednesday, March 13, 2013 2:46:06 PM UTC-7, puzzler wrote:

> On Wed, Mar 13, 2013 at 2:06 PM, Marko Topolnik 
> 
> > wrote:
>
>
>> As far as I understand it, *set!* modifies the *thread-local* binding, 
>> just like the *binding* macro, but doesn't delimit a definite scope of 
>> validity for the binding. You can *set!* any dynamic var with the same 
>> semantics.
>>
>
> You can't just set! any dynamic var, you can only set! vars that are both 
> dynamic *and* have been bound again with the binding construct.
>
> => (def ^:dynamic a 2)
> #'user/a
> => (set! a 3)
> IllegalStateException Can't change/establish root binding of: a with set  
> clojure.lang.Var.set (Var.java:233)
> => (binding [a 1] (set! a 3))
> 3
>
>
> This is why I'm puzzled about how things like (set! *unchecked-math* true) 
> are handled.  Clearly, in this special case you can use set! without first 
> calling binding.
>

Not really a special case, although I suppose you could argue it either 
way. These vars, too, must be bound before being set!. But the code that 
binds them is in the compiler: 
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compile.java#L72
 binds 
*unchecked-math*  *warn-on-reflection* before it starts compiling files. 
The only way you could make your own vars be set!able is to use them inside 
a context in which they've already been bound; for example, you could 
define a (let-me-set-stuff &body) macro and evaluate the user's code in 
that context. That's basically the same as how the compiler and the repl 
work: they run all of your code in a context where bindings are 
established. 

-- 
-- 
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/groups/opt_out.




Re: set!

2013-03-13 Thread Herwig Hochleitner
2013/3/13 Mark Engelberg 

> Still, it would be nice to understand whether it's possible to achieve the
> same effect as Clojure core's settable vars.
>

It is, because clojure doesn't do anything magic here (apart from the
effects its set!-able vars have ;-).
The catch is: The set of commonly set!-able vars is tied to clojure's
release version. And as we all know, this context is controlled by
clojure/core, in the hope of ruling out bad majority decisions.

Proof by command line:

> java -cp clojure-1.5.0.jar clojure.main -h
... snip ...
  operation:

- Establishes thread-local bindings for commonly set!-able vars
... snip ...

So presumably, you would have to get the var you want to have "globally"
set!-able into clojure.main, or lobby for a general purpose hook to
globally add dynamic bindings to a thread (a bad idea in my gut intuition).

*user=>* (.start (Thread. #(set! *unchecked-math* true)))
nil
Exception in thread "Thread-3" java.lang.IllegalStateException: Can't
change/establish root binding of: *unchecked-math* with set
 at clojure.lang.Var.set(Var.java:233)

;; so no, clojures set!-able vars aren't magically carried over to new
threads either

Opinions

IMO set!-able vars only make sense, if you control the context in which the
vars are set!-able. Dynamic bindings are plenty volatile as they are,
especially in combination with lazy sequences (just happened to me again
today). The ability to introduce *new* bindings *across* or *up* the
dynamic scope certainly wouldn't help there.

I think the easiest way to offer your users to control part of their
context (to "globally" introduce set!-able vars and other stuff) are:
leiningen plugins.

-- 
-- 
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/groups/opt_out.




Re: set!

2013-03-13 Thread Stephen Gilardi
The repl's thread binding for those vars is set here:

  https://github.com/clojure/clojure/blob/master/src/clj/clojure/main.clj#L267

using this macro:

  https://github.com/clojure/clojure/blob/master/src/clj/clojure/main.clj#L85

Users of your library would need to do something similar, possibly wrapping a 
call to clojure.main/repl within a clojure.core/with-bindings form, to allow 
the same set! ability for your vars.

--Steve

On Mar 13, 2013, at 5:47 PM, Mark Engelberg  wrote:

> On Wed, Mar 13, 2013 at 2:36 PM, Michael Klishin 
>  wrote:
> alter-var-root works fine for that purpose, e.g.
> https://github.com/michaelklishin/monger/blob/master/src/clojure/monger/core.clj#L168-171
> 
> Thanks.  That's probably what I'll end up doing.  Still, it would be nice to 
> understand whether it's possible to achieve the same effect as Clojure core's 
> settable vars. 

-- 
-- 
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/groups/opt_out.




Re: set!

2013-03-13 Thread Mark Engelberg
OK, that answers my question.  Thanks for the insights everyone!

-- 
-- 
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/groups/opt_out.




Re: What's the point of -> ?

2013-03-13 Thread Mike Norman
This is absolutely the wrong understanding of the benefits of Clojure's syntax. 
Its main benefit is not minimalism. Its main benefit is simplicity, which is 
less akin to ordinality than it is to orthogonality. In this case, there is a 
tool that just does chaining, which allows you to compose calls in a more 
readable way, but by using existing pieces. It decomplects order and 
application for the sake of, at least, readability.

-- 
-- 
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/groups/opt_out.




[ANN] shopify-clj

2013-03-13 Thread James MacAulay
I work at Shopify  and this has been my weekend 
project for a little while now:

https://github.com/jamesmacaulay/shopify-clj

It's a library for interacting with shops through our API. It includes a 
Friend workflow and an API wrapper based on clj-http with a custom 
middleware stack.

The Shopify App Store  has examples of how other 
people have used the API to extend the capabilities of our customers' 
shops. Some of these apps are built especially for our platform, and some 
are integrations with existing services which just go really well with a 
Shopify shop . Some of them are free, 
some of them hook into our billing 
system, 
and some of them use their own solution for getting paid.

This is my first "real library" in Clojure, and I would *love* to get 
feedback from you folks about the choices I've made. It's been a great 
learning experience and I've tried hard to play to the strengths of the 
language.

More to come in 0.2.0 and beyond:

   - a leiningen template for Shopify web apps
   - validations, or at least better ways of working with remote validation 
   errors
   - functions to help with handling 
webhooks

Cheers and happy coding,
James

-- 
-- 
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/groups/opt_out.




Re: ClojureCLR - Question about the "Debug 3.5" build configuration and "System.Reflection.Assembly.IsDynamic" property

2013-03-13 Thread dmiller

Fixed in master.


> On Tuesday, March 12, 2013 11:43:58 PM UTC-5, FC wrote:
>>
>> Hi,
>>
>> I'm trying to build ClojureCLR from the latest clojure-clr-master.ZIP 
>> file I downloaded from GitHub. 
>>
>> With "Debug 3.5" as the build configuration I get a compilation error in 
>> Clojure\lib\RT.cs that "System.Reflection.Assembly does not contain a 
>> definition for 'IsDynamic'".
>>
>> Is this expected? When I use "Debug 4.0" it builds fine.
>>
>> Thank you.
>>
>> -Fiel
>>
>

-- 
-- 
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/groups/opt_out.




Trying to understand Java better to understand Clojure better

2013-03-13 Thread Daniel Higginbotham
I've been feeling like my lack of Java knowledge has been holding me back 
with Clojure, so I've started to learn it and have written an article on 
how you compile and run a Java 
program: 
http://www.flyingmachinestudios.com/programming/how-clojure-babies-are-made-the-java-cycle/
 
. Is the information in the article accurate? I'm not 100% sure and would 
love any feedback. Also, are there any other resources for this kind of 
info?

Please forgive me if I shouldn't be sending a link to my blog to the 
mailing list - I don't know whether this is proper etiquette or not.

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/groups/opt_out.




Re: Trying to understand Java better to understand Clojure better

2013-03-13 Thread Jason Lewis
I actually really enjoyed the article... it wasn't much new for me in terms
of Java, but I think one of the places we're lacking in documentation is
help for Java n00bs trying to get a handle on JVM programming, especially
since the "idiomatic" way of accessing Java from Clojure is directly.

Personally, I'm grateful for the plethora of libraries that wrap Java libs
in "pure" Clojure so I don't have to think about Java when I'm writing
Clojure. One of the things that turned me off about CL and Racket was
writing awful FFI llibs to hook into C system libs.

What I'd love to see is a tutorial on abstracting Java classes and
interfaces in pure Clojure, and perhaps something like Ruby's FFI lib that
lets you forget about the runtime you're using (Clojure, ClojureCLR, even
some of the neophyte efforts like C Clojure or Clojure-in-Clojure)...

Ok, rambling a bit here... but I love the fact that Clojure lets me
leverage the entire Java stdlib, I just wish I didn;t have to switch gears
and think about how to proxy that
AbstractSingletonFactoryFactoryInterfaceFactory to write the Lisp-y code I
wanted to in the first place.

Just my $0.02...


Jason Lewis

Email  jasonlewi...@gmail.com

Twitter@canweriotnow 

Blog   http://decomplecting.org

About http://about.me/jason.lewis


On Wed, Mar 13, 2013 at 10:58 PM, Daniel Higginbotham <
nonrecurs...@gmail.com> wrote:

> I've been feeling like my lack of Java knowledge has been holding me back
> with Clojure, so I've started to learn it and have written an article on
> how you compile and run a Java program:
> http://www.flyingmachinestudios.com/programming/how-clojure-babies-are-made-the-java-cycle/.
>  Is the information in the article accurate? I'm not 100% sure and would
> love any feedback. Also, are there any other resources for this kind of
> info?
>
> Please forgive me if I shouldn't be sending a link to my blog to the
> mailing list - I don't know whether this is proper etiquette or not.
>
> 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/groups/opt_out.
>
>
>

-- 
-- 
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/groups/opt_out.