<< Back to previous view

[TNS-26] Attempted call to clojure.core/alias appears to be shadowed by local binding to name 'alias' Created: 29/Sep/14  Updated: 10/Oct/14  Resolved: 10/Oct/14

Status: Resolved
Project: tools.namespace
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Andy Fingerhut Assignee: Stuart Sierra
Resolution: Completed Votes: 0
Labels: None


 Description   

I discovered this while testing a new linter for Eastwood [1], not by running code, so I don't know what the run-time effect of this issue is, but I would guess it would cause an exception to be thrown if the last line of function recover-ns is ever executed.

Either that or I am really confused by the last line of function recover-ns

[1] https://github.com/jonase/eastwood



 Comments   
Comment by Stuart Sierra [ 10/Oct/14 9:59 AM ]

Good catch, thanks! Fixed in 122e3d1d

It didn't throw an exception because the local binding of alias was a symbol. When you invoke a symbol, it behaves like keywords or get, so there was no error.





[TNS-27] c.t.n.repl/refresh fails if :main is specified in project.clj Created: 14/Nov/14  Updated: 14/Nov/14  Resolved: 14/Nov/14

Status: Resolved
Project: tools.namespace
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Keisuke Fukuda Assignee: Stuart Sierra
Resolution: Declined Votes: 0
Labels: None
Environment:

[org.clojure/tools.namespace "0.2.7"]
REPL-y 0.1.0-beta10
Clojure 1.6.0
Leiningen 2.0.0-preview10 on Java 1.8.0_20 Java HotSpot(TM) 64-Bit Server VM



 Description   

If ":main" is specified in a project.clj file, c.t.n.repl/refresh function fails.

Here's the procedure to reproduce the error.

$ cat ~/.lein/profiles.clj
{:user
{:dependencies [[org.clojure/tools.namespace "0.2.7"]
[spyscope "0.1.3"]
[criterium "0.4.1"]]
:injections [(require '(clojure.tools.namespace repl find))
(try (require 'spyscope.core)
(catch RuntimeException e))]
:plugins [ ]}}

$ lein new myproj
$ cd myproj
$ lein deps
$ lein repl
nREPL server started on port 52414
REPL-y 0.1.0-beta10
Clojure 1.6.0
Exit: Control+D or (exit) or (quit)
Commands: (user/help)
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
(user/sourcery function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Examples from clojuredocs.org: [clojuredocs or cdoc]
(user/clojuredocs name-here)
(user/clojuredocs "ns-here" "name-here")
user=> (use '[clojure.tools.namespace.repl :only (refresh)])
nil
user=> (refresh)
:reloading (myproj.core myproj.core-test)
:ok

;;; ** it works without :main in project.clj

$ vi project.clj
$ cat project.clj
(defproject myproj "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:main myproj.core
:dependencies [[org.clojure/clojure "1.6.0"]])

$ lein repl

<snip>

myproj.core=> (use '[clojure.tools.namespace.repl :only (refresh)])
nil
myproj.core=> (refresh)
:reloading (myproj.core myproj.core-test)
:error-while-loading myproj.core-test
#<CompilerException java.lang.Exception: namespace 'myproj.core' not found, compiling:(myproj/core_test.clj:1:1)>



 Comments   
Comment by Stuart Sierra [ 14/Nov/14 10:44 AM ]

This is a known Clojure issue: reloading AOT-compiled code doesn't work.

:main in Leiningen's project.clj file triggers AOT-compilation.

Documented here: https://github.com/clojure/tools.namespace/blob/122e3d1d4fb01e4f1412d5cc7ec80dce76e8778a/README.md#warnings

Comment by Keisuke Fukuda [ 14/Nov/14 10:48 AM ]

Stuart,
I took some time to googling but couldn't reach the information. Sorry for submitting a known issue and thanks for your time.





[TNS-25] A few doc string typos Created: 09/Sep/14  Updated: 19/Sep/14  Resolved: 19/Sep/14

Status: Resolved
Project: tools.namespace
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Trivial
Reporter: Andy Fingerhut Assignee: Stuart Sierra
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File tns-25-v1.patch    
Patch: Code

 Description   

Attached patch corrects a few misspellings in tools.namespace doc strings



 Comments   
Comment by Stuart Sierra [ 19/Sep/14 9:06 AM ]

Applied in https://github.com/clojure/tools.namespace/commit/09e1e1fd81faed4e24399bf68bf78e87b32eb68b

Thanks.





Generated at Sat Nov 22 20:28:16 CST 2014 using JIRA 4.4#649-r158309.