Re: Misleading Exception due to function name containing ->

2011-09-12 Thread Stefan Kamphausen
Just some more, maybe even simpler examples: Clojure 1.3.0-master-SNAPSHOT user=> (defn foo>>bar [] "") user=> (foo>>bar "a") ArityException Wrong number of args (1) passed to: user$foo-GT clojure.lang.AFn.throwArity (AFn.java:439) user=> (defn foo++bar [a] "") user=> (foo++bar) ArityException

Re: Misleading Exception due to function name containing ->

2011-09-12 Thread Stefan Kamphausen
Hi, On Monday, September 12, 2011 8:07:22 PM UTC+2, Chouser wrote: > > > https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/AFn.java#L436 > looks like a subtle bug, doesn't it? The compiler translates '-' to '_' (Compiler.java:2619) and '>' to '_GT_' (Compiler.java:2623). Toge

Re: Misleading Exception due to function name containing ->

2011-09-12 Thread Chouser
On Mon, Sep 12, 2011 at 11:39 AM, Sean Corfield wrote: > On Mon, Sep 12, 2011 at 8:16 AM, Stefan Kamphausen > wrote: >> Maybe the example becomes clearer with a little less foo and a little more >> bar and baz: >> >> shell> lein repl >> REPL started; server listening on localhost port 64913 >> us

Re: Misleading Exception due to function name containing ->

2011-09-12 Thread Sean Corfield
On Mon, Sep 12, 2011 at 8:16 AM, Stefan Kamphausen wrote: > Maybe the example becomes clearer with a little less foo and a little more > bar and baz: > > shell> lein repl > REPL started; server listening on localhost port 64913 > user=> (defn foo [arg] "foo") > #'user/foo > user=> (defn bar->baz [

Re: Misleading Exception due to function name containing ->

2011-09-12 Thread Stefan Kamphausen
Maybe the example becomes clearer with a little less foo and a little more bar and baz: shell> lein repl REPL started; server listening on localhost port 64913 user=> (defn foo [arg] "foo") #'user/foo user=> (defn bar->baz [a b] "bar->baz") #'user/bar->baz user=> (foo (bar->baz "a")) java.lang.Il

Re: Misleading Exception due to function name containing ->

2011-09-12 Thread Michael Wood
On 12 September 2011 15:49, Christina Conway wrote: > user=> (defn foo [a] "") > #'user/foo > user=> (defn foo->foo2 [a b] "") > #'user/foo->foo2 > user=> (foo (foo->foo2 "a")) > java.lang.IllegalArgumentException: Wrong number of args (1) passed to: > user$foo (NO_SOURCE_FILE:0) > > This example

Re: Misleading Exception due to function name containing ->

2011-09-12 Thread Christina Conway
user=> (defn foo [a] "") #'user/foo user=> (defn foo->foo2 [a b] "") #'user/foo->foo2 user=> (foo (foo->foo2 "a")) java.lang.IllegalArgumentException: Wrong number of args (1) passed to: user$foo (NO_SOURCE_FILE:0) This example illustrates the problem. The exception indicates that the foo function

Re: Misleading Exception due to function name containing ->

2011-09-12 Thread Chouser
On Fri, Sep 9, 2011 at 4:47 AM, Christina Conway wrote: > A function name contains the characters -> >   e.g.  foo->fn > The function causes an exception. > However the exception is not reported on the function but on another > function called before it. >   java.lang.IllegalArgumentException: Wro

Re: Misleading Exception due to function name containing ->

2011-09-12 Thread Christina Conway
Thanks for the suggestion BG. I tried using clj-stacktrace but the function name is still not displayed correctly in the trace. Regards, cc On 11 September 2011 13:53, Baishampayan Ghose wrote: > > The foo->fn function is compiled to a .class file as: > > foo__GT_fn.class > > The foo>fn functio

Re: Misleading Exception due to function name containing ->

2011-09-11 Thread Baishampayan Ghose
> The foo->fn function is compiled to a .class file as: > foo__GT_fn.class > The foo>fn function is compiled to a .class file as: > foo_GT_fn.class > The foo-fn function is compiled to a .class file as: > foo_fn.class > > Has anybody else encountered this with function names containing ->. > Is thi

Re: Misleading Exception due to function name containing ->

2011-09-11 Thread Jonathan Fischer Friberg
I've had no problems with functions containing -> Jonathan On Fri, Sep 9, 2011 at 10:47 AM, Christina Conway wrote: > A function name contains the characters -> > e.g. foo->fn > The function causes an exception. > However the exception is not reported on the function but on another > function

Misleading Exception due to function name containing ->

2011-09-10 Thread Christina Conway
A function name contains the characters -> e.g. foo->fn The function causes an exception. However the exception is not reported on the function but on another function called before it. java.lang.IllegalArgumentException: Wrong number of args (1) passed to: datetime$other-fn If the > charac