librelist archives

« back to archive

Exception with :main and calling undef'd function in -main

Exception with :main and calling undef'd function in -main

From:
Andy Fingerhut
Date:
2013-03-22 @ 23:35
Details of version numbers of things that I'm using below, in case it makes
a difference.  I have boiled this down to what is probably a minimal test
case, after experiencing the behavior in a somewhat larger project.

% lein new weirdfail
% cd weirdfail

Add line ":main weirdfail.core" to project.clj
Edit src/weirdfail/core.clj so it has this function at the end.  It is
important that "bar" is not defined anywhere.

(defn -main [& args]
  (bar))

When I run "lein repl", I get this:

% lein repl
nREPL server started on port 58404
CompilerException java.lang.RuntimeException: Unable to resolve symbol:
defmacro in this context, compiling:(NO_SOURCE_PATH:1:5)
reply.eval-modes.nrepl=>

If I do any *one* of the following changes by itself, I can do "lein repl"
and things start up normally:

+ Remove ":main weirdfail.core" line from project.clj
+ Remove (bar) from -main, or change it to a call to (foo), which is
defined earlier in the file.

Bug?  If so, in what software?

Environment: Mac OS X 10.8.3
% lein version
Leiningen 2.1.1 on Java 1.7.0_15 Java HotSpot(TM) 64-Bit Server VM

Thanks,
Andy

Re: [leiningen] Exception with :main and calling undef'd function in -main

From:
Colin Jones
Date:
2013-03-23 @ 00:12
Almost certainly a REPLy initialization bug. I'll take a look soon - mind
opening a GH issue? https://github.com/trptcolin/reply

On Friday, March 22, 2013, Andy Fingerhut wrote:

> Details of version numbers of things that I'm using below, in case it
> makes a difference.  I have boiled this down to what is probably a minimal
> test case, after experiencing the behavior in a somewhat larger project.
>
> % lein new weirdfail
> % cd weirdfail
>
> Add line ":main weirdfail.core" to project.clj
> Edit src/weirdfail/core.clj so it has this function at the end.  It is
> important that "bar" is not defined anywhere.
>
> (defn -main [& args]
>   (bar))
>
> When I run "lein repl", I get this:
>
> % lein repl
> nREPL server started on port 58404
> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
> defmacro in this context, compiling:(NO_SOURCE_PATH:1:5)
> reply.eval-modes.nrepl=>
>
> If I do any *one* of the following changes by itself, I can do "lein repl"
> and things start up normally:
>
> + Remove ":main weirdfail.core" line from project.clj
> + Remove (bar) from -main, or change it to a call to (foo), which is
> defined earlier in the file.
>
> Bug?  If so, in what software?
>
> Environment: Mac OS X 10.8.3
> % lein version
> Leiningen 2.1.1 on Java 1.7.0_15 Java HotSpot(TM) 64-Bit Server VM
>
> Thanks,
> Andy
>
>

-- 
Colin Jones
@trptcolin

Re: [leiningen] Exception with :main and calling undef'd function in -main

From:
Andy Fingerhut
Date:
2013-03-23 @ 01:02
Done.

Thanks,
Andy

On Fri, Mar 22, 2013 at 5:12 PM, Colin Jones <trptcolin@gmail.com> wrote:

> Almost certainly a REPLy initialization bug. I'll take a look soon - mind
> opening a GH issue? https://github.com/trptcolin/reply
>
>
> On Friday, March 22, 2013, Andy Fingerhut wrote:
>
>> Details of version numbers of things that I'm using below, in case it
>> makes a difference.  I have boiled this down to what is probably a minimal
>> test case, after experiencing the behavior in a somewhat larger project.
>>
>> % lein new weirdfail
>> % cd weirdfail
>>
>> Add line ":main weirdfail.core" to project.clj
>> Edit src/weirdfail/core.clj so it has this function at the end.  It is
>> important that "bar" is not defined anywhere.
>>
>> (defn -main [& args]
>>   (bar))
>>
>> When I run "lein repl", I get this:
>>
>> % lein repl
>> nREPL server started on port 58404
>> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
>> defmacro in this context, compiling:(NO_SOURCE_PATH:1:5)
>> reply.eval-modes.nrepl=>
>>
>> If I do any *one* of the following changes by itself, I can do "lein
>> repl" and things start up normally:
>>
>> + Remove ":main weirdfail.core" line from project.clj
>> + Remove (bar) from -main, or change it to a call to (foo), which is
>> defined earlier in the file.
>>
>> Bug?  If so, in what software?
>>
>> Environment: Mac OS X 10.8.3
>> % lein version
>> Leiningen 2.1.1 on Java 1.7.0_15 Java HotSpot(TM) 64-Bit Server VM
>>
>> Thanks,
>> Andy
>>
>>
>
> --
> Colin Jones
> @trptcolin
>