shdqcdsn / counterclockwise

Automatically exported from code.google.com/p/counterclockwise
0 stars 0 forks source link

auto (use 'clojure.repl) to allow source/doc/pst to be usable #511

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
=> doc
CompilerException java.lang.RuntimeException: Unable to resolve symbol: doc in 
this context, compiling:(NO_SOURCE_PATH:1:42) 
=> source
CompilerException java.lang.RuntimeException: Unable to resolve symbol: source 
in this context, compiling:(NO_SOURCE_PATH:1:42) 
=> pst
CompilerException java.lang.RuntimeException: Unable to resolve symbol: pst in 
this context, compiling:(NO_SOURCE_PATH:1:42) 

=> (use 'clojure.repl)
nil

they work now.

I'm not sure what's the best way for this, but I find myself having to type 
(use 'clojure.repl) so many times, especially right after I type (pst) which 
errs and now the actual exception is overwritten by the pst not being found 
exception, so I have to re-execute ...

Is there a script that ccw will execut when starting the repl? maybe I could 
just put the use there 

Original issue reported on code.google.com by atkaaz on 21 Jan 2013 at 4:07

GoogleCodeExporter commented 9 years ago
I just realized that this only happens on ie. clojure 1.5.0-RC1  but not with 
clojure 1.4.0  (in project.clj I mean)
So, in 1.4.0 doc/source are already available

Original comment by atkaaz on 22 Jan 2013 at 11:05

GoogleCodeExporter commented 9 years ago
Yes, a new class of problems for tools have been introduced with this new 
"correctness" introduced in clojure 1.5.

The new behaviour in 1.5 is so that the tools do not step on user defined 
namespaces when they want to name their vars like source, doc, etc.

Original comment by laurent....@gmail.com on 24 Jan 2013 at 4:49

GoogleCodeExporter commented 9 years ago
Issue 551 has been merged into this issue.

Original comment by Gunnar.V...@googlemail.com on 23 Apr 2013 at 3:04

GoogleCodeExporter commented 9 years ago
This behavior is really annoying in every day usage of CCW.
I swear about it many times a day so I dared to raise its priority.

Original comment by Gunnar.V...@googlemail.com on 23 Apr 2013 at 3:07

GoogleCodeExporter commented 9 years ago
Let's check with Chas, since he may have new ideas in this area

Original comment by laurent....@gmail.com on 23 Apr 2013 at 3:23

GoogleCodeExporter commented 9 years ago
There's no easy fix for this.  Because the REPL utilities are coming from 
clojure.repl and not clojure.core, the rules for overriding them with a local 
definition are different (i.e. just a warning for vars defined using names of 
vars referred in from the latter, but errors otherwise).

What you really want is expression rewriting prior to the point at which the 
actual read-eval-print-loop gets a hold of it.  This would implicitly turn (doc 
foo) into (clojure.repl/doc foo), of course unless a namespace-local `doc` 
existed.  All of the pieces for this exist (nREPL middleware + sjacket), but 
have yet to be put together with some reasonable default Leiningen (+ reply) 
policy.

Original comment by c...@cemerick.com on 6 May 2013 at 8:41

GoogleCodeExporter commented 9 years ago
If I did not miss something, repl-y seems to do it just via `refer` in its init 
code 
(https://github.com/trptcolin/reply/blob/master/src/clj/reply/initialization.clj
#L150).

Original comment by Gunnar.V...@googlemail.com on 7 May 2013 at 6:54

GoogleCodeExporter commented 9 years ago
I've fallen back to adding (:use clojure.repl) to every namespace now.

Original comment by m...@ataggart.ca on 16 May 2013 at 2:57

GoogleCodeExporter commented 9 years ago
What about having a customizable automatic addition of an alias to clojure.repl?

By default, it could be repl, so that now you would use (repl/doc ....) 
(repl/source ....) ?

Original comment by laurent....@gmail.com on 5 Jul 2013 at 12:44

GoogleCodeExporter commented 9 years ago
Why not just refer those if they are not present in the namespace?
It is better for every day use to have them as short as possible.

Original comment by Gunnar.V...@googlemail.com on 12 Jul 2013 at 8:55

GoogleCodeExporter commented 9 years ago
Issue 582 has been merged into this issue.

Original comment by laurent....@gmail.com on 3 Oct 2013 at 4:53

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 22 May 2014 at 9:34

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 10 Jul 2014 at 6:53

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 10 Jul 2014 at 6:53

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 10 Jul 2014 at 8:12

GoogleCodeExporter commented 9 years ago
Now that Leiningen project.clj is correctly handled, this should be less of a 
problem since now the behaviour is "aligned" with the Leiningen user experience?

Original comment by laurent....@gmail.com on 17 Jul 2014 at 1:39

GoogleCodeExporter commented 9 years ago
Issue 598 has been merged into this issue.

Original comment by laurent....@gmail.com on 17 Jul 2014 at 1:42

GoogleCodeExporter commented 9 years ago
Issue 598 has good points: 
Reported by tukte@tpnet.fi, Nov 6, 2013
I think that these commonly used namespaces should be loaded by default as it 
was with clojure 1.4.

I think that this could be done by editing ClojureLaunchDelegate line 226.

I think it should be like(not tested) 

String.format("(do (clojure.tools.nrepl.server/start-server :ack-port %s)"
                        + "(require 'clojure.pprint)"
                        + "(require 'clojure.repl) "
                        + "nil)", CCWPlugin.getDefault().getREPLServerPort());

Original comment by laurent....@gmail.com on 17 Jul 2014 at 1:43

GoogleCodeExporter commented 9 years ago
Issue 598 has been merged into this issue.

Original comment by laurent....@gmail.com on 17 Jul 2014 at 2:49

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 21 Aug 2014 at 8:36

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 25 Sep 2014 at 9:29