Re: 1.9.0-alpha14 doesn't allow Java classes as return type in gen-class :method clause?

2017-03-06 Thread Mars0i
On Monday, March 6, 2017 at 10:33:43 AM UTC-6, Mars0i wrote:
>
> On Monday, March 6, 2017 at 9:32:37 AM UTC-6, Alex Miller wrote:
>>
>> Ok, this looks like it's related to the macro gen, so I don't see any 
>> issue to fix in the spec - valid inputs at the point are either strings or 
>> symbols - I think through eval you were ending up with a class instance.
>>
>
> OK, that makes sense.  The new version with the added quote works with 
> 1.8.0 as well as 1.9.0--no doubt that's what you'd expect.  I wouldn't have 
> to known for sure until I tried it.  Use of gen-class can seem like a black 
> art sometimes :-) but I'm glad it's available.
>

Of course the problem arose due to my decision to dabble, imperfectly, in 
the black art of macro-writing (which I usually can avoid).

btw when I first saw the 1.9.0 error dump I thought it was horrible--worse 
than a simple Java stacktrace.  It was pretty ugly because my macro had 
generated a very large expression.  Once I figured out what the spec output 
was saying, though, I realized how incredibly helpful it was.  Very nice.  
Thanks.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.9.0-alpha14 doesn't allow Java classes as return type in gen-class :method clause?

2017-03-06 Thread Mars0i


On Monday, March 6, 2017 at 9:32:37 AM UTC-6, Alex Miller wrote:
>
> Ok, this looks like it's related to the macro gen, so I don't see any 
> issue to fix in the spec - valid inputs at the point are either strings or 
> symbols - I think through eval you were ending up with a class instance.
>

OK, that makes sense.  The new version with the added quote works with 
1.8.0 as well as 1.9.0--no doubt that's what you'd expect.  I wouldn't have 
to known for sure until I tried it.  Use of gen-class can seem like a black 
art sometimes :-) but I'm glad it's available.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.9.0-alpha14 doesn't allow Java classes as return type in gen-class :method clause?

2017-03-06 Thread Alex Miller
Ok, this looks like it's related to the macro gen, so I don't see any issue 
to fix in the spec - valid inputs at the point are either strings or 
symbols - I think through eval you were ending up with a class instance.

On Monday, March 6, 2017 at 1:16:38 AM UTC-6, Mars0i wrote:
>
>
>
> On Sunday, March 5, 2017 at 6:51:57 PM UTC-6, Alex Miller wrote:
>>
>> I would really appreciate seeing the ns declaration that caused the 
>> original error. I have not been able to exactly reproduce what you are 
>> describing. If you can't share it publicly, you can send it to me at 
>> alex@cognitect.com.
>>
>> Thanks,
>> Alex
>>
>
> Thanks--sure, I am willing to make public the ... bad things I am doing in 
> my code.  I have to explain that the ns declaration is very large; it's 
> generated by a macro that creates a lot of code.  I wrote it to ease 
> interop with a useful but not entirely Clojure-friendly Java library I'm 
> using.  This required violating some standard, useful coding guidelines.
>
> This file 
> 
>  
> contains pretty-printed output from macroexpand-1 (made with Clojure 
> 1.8.0--the offending macro call is in an aot-compiled file, so it would 
> have been harder to start the repl with 1.9.0).  There are actually two ns 
> declarations (a trick to avoid some cyclic references).  The code that 
> caused the errors begins at line 66 in the second ns.
>
> The macro call in my source is here 
> on
>  
> line 29, and the macro definition is at the bottom of this file 
> .
>   
> Both of those links are to the code just before the commit in which I added 
> apostrophes to the instances of java.lang.Object (at line 210 of the macro 
> definition file).  This got rid of the errors, and the application seems to 
> run correctly.
>
> (If you look at the current version of the code, you'll see that I 
> recently changed the project name from free-agent to pasta; 'lein uberjar' 
> didn't like the hyphen.)
>
> If you need me to make a minimal example, I can probably do that.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.9.0-alpha14 doesn't allow Java classes as return type in gen-class :method clause?

2017-03-06 Thread Mars0i


On Monday, March 6, 2017 at 1:16:38 AM UTC-6, Mars0i wrote:
>
>
> On Sunday, March 5, 2017 at 6:51:57 PM UTC-6, Alex Miller wrote:
>>
>> I would really appreciate seeing the ns declaration that caused the 
>> original error. I have not been able to exactly reproduce what you are 
>> describing. If you can't share it publicly, you can send it to me at 
>> alex@cognitect.com.
>>
>> Thanks,
>> Alex
>>
>
> Thanks--sure, I am willing to make public the ... bad things I am doing in 
> my code.  I have to explain that the ns declaration is very large; it's 
> generated by a macro that creates a lot of code.  I wrote it to ease 
> interop with a useful but not entirely Clojure-friendly Java library I'm 
> using.  This required violating some standard, useful coding guidelines.
>
> This file 
> 
>  
> contains pretty-printed output from macroexpand-1 (made with Clojure 
> 1.8.0--the offending macro call is in an aot-compiled file, so it would 
> have been harder to start the repl with 1.9.0).  There are actually two ns 
> declarations (a trick to avoid some cyclic references).  The code that 
> caused the errors begins at line 66 in the second ns.
>
> The macro call in my source is here 
> on
>  
> line 29, and the macro definition is at the bottom of this file 
> .
>   
> Both of those links are to the code just before the commit in which I added 
> apostrophes to the instances of java.lang.Object (at line 210 of the macro 
> definition file).  This got rid of the errors, and the application seems to 
> run correctly.
>
> (If you look at the current version of the code, you'll see that I 
> recently changed the project name from free-agent to pasta; 'lein uberjar' 
> didn't like the hyphen.)
>
> If you need me to make a minimal example, I can probably do that.
>

I meant to mention, in case it turns out to be relevant, that the other odd 
thing about this code is that the second ns declaration generated by the 
macro is a second instance of the ns declaration at the top of the source 
file.  i.e. at the top of SimConfig.clj there's a hardcoded ns declaration 
(ns free-agent.SimConfig ...), and then the macro inserts a different ns 
declaration (ns free-agent.config-data), followed a few lines later by a 
different instance of (ns free-agent.SimConfig ...).  It's in the latter 
that the :gen-class clause which causes the error occurs.  The reason for 
the (ns X), (ns Y), (ns X) strategy is to avoid the potential cyclic 
dependency problem (forced on me by the MASON library I'm using).

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.9.0-alpha14 doesn't allow Java classes as return type in gen-class :method clause?

2017-03-05 Thread Mars0i


On Sunday, March 5, 2017 at 6:51:57 PM UTC-6, Alex Miller wrote:
>
> I would really appreciate seeing the ns declaration that caused the 
> original error. I have not been able to exactly reproduce what you are 
> describing. If you can't share it publicly, you can send it to me at 
> alex@cognitect.com .
>
> Thanks,
> Alex
>

Thanks--sure, I am willing to make public the ... bad things I am doing in 
my code.  I have to explain that the ns declaration is very large; it's 
generated by a macro that creates a lot of code.  I wrote it to ease 
interop with a useful but not entirely Clojure-friendly Java library I'm 
using.  This required violating some standard, useful coding guidelines.

This file 

 
contains pretty-printed output from macroexpand-1 (made with Clojure 
1.8.0--the offending macro call is in an aot-compiled file, so it would 
have been harder to start the repl with 1.9.0).  There are actually two ns 
declarations (a trick to avoid some cyclic references).  The code that 
caused the errors begins at line 66 in the second ns.

The macro call in my source is here 
on
 
line 29, and the macro definition is at the bottom of this file 
.
  
Both of those links are to the code just before the commit in which I added 
apostrophes to the instances of java.lang.Object (at line 210 of the macro 
definition file).  This got rid of the errors, and the application seems to 
run correctly.

(If you look at the current version of the code, you'll see that I recently 
changed the project name from free-agent to pasta; 'lein uberjar' didn't 
like the hyphen.)

If you need me to make a minimal example, I can probably do that.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.9.0-alpha14 doesn't allow Java classes as return type in gen-class :method clause?

2017-03-05 Thread Alex Miller
I would really appreciate seeing the ns declaration that caused the 
original error. I have not been able to exactly reproduce what you are 
describing. If you can't share it publicly, you can send it to me at 
alex.mil...@cognitect.com.

Thanks,
Alex

On Saturday, March 4, 2017 at 8:10:35 AM UTC-6, Mars0i wrote:
>
> On Saturday, March 4, 2017 at 7:58:38 AM UTC-6, Mars0i wrote:
>>
>> On Saturday, March 4, 2017 at 7:24:05 AM UTC-6, Alex Miller wrote:
>>>
>>> This is definitely related to the gen-class spec, but I'm not at a 
>>> computer to look at enough stuff to say if the bug is your code or the 
>>> spec. 
>>>
>>> You might try quoting rhe class name in case it's getting resolved to a 
>>> class instance? Might be crazy talk.
>>>
>>
>> That produced pretty much the same error:
>>
>> In: [3 :methods 32 2] val: "java.lang.Object" fails spec: 
>> :clojure.core.specs/method at: [:args :clauses :gen-class :options :methods 
>> :return-type] predicate: simple-symbol?
>>
>>  
> Oh--sorry.  You  probably meant the other kind of quoting, i.e. with 
> apostrophe, the Clojure special form quote.  That fixed it.  Thanks very 
> much.
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.9.0-alpha14 doesn't allow Java classes as return type in gen-class :method clause?

2017-03-04 Thread Mars0i
On Saturday, March 4, 2017 at 7:58:38 AM UTC-6, Mars0i wrote:
>
> On Saturday, March 4, 2017 at 7:24:05 AM UTC-6, Alex Miller wrote:
>>
>> This is definitely related to the gen-class spec, but I'm not at a 
>> computer to look at enough stuff to say if the bug is your code or the 
>> spec. 
>>
>> You might try quoting rhe class name in case it's getting resolved to a 
>> class instance? Might be crazy talk.
>>
>
> That produced pretty much the same error:
>
> In: [3 :methods 32 2] val: "java.lang.Object" fails spec: 
> :clojure.core.specs/method at: [:args :clauses :gen-class :options :methods 
> :return-type] predicate: simple-symbol?
>
>  
Oh--sorry.  You  probably meant the other kind of quoting, i.e. with 
apostrophe, the Clojure special form quote.  That fixed it.  Thanks very 
much.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.9.0-alpha14 doesn't allow Java classes as return type in gen-class :method clause?

2017-03-04 Thread Mars0i
On Saturday, March 4, 2017 at 7:24:05 AM UTC-6, Alex Miller wrote:
>
> This is definitely related to the gen-class spec, but I'm not at a 
> computer to look at enough stuff to say if the bug is your code or the 
> spec. 
>
> You might try quoting rhe class name in case it's getting resolved to a 
> class instance? Might be crazy talk.
>

That produced pretty much the same error:

In: [3 :methods 32 2] val: "java.lang.Object" fails spec: 
:clojure.core.specs/method at: [:args :clauses :gen-class :options :methods 
:return-type] predicate: simple-symbol?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.