proto-repl icon indicating copy to clipboard operation
proto-repl copied to clipboard

(range) freezes auto eval

Open JamesMcMahon opened this issue 8 years ago • 6 comments

I'm new to proto-repl and it seems really great so far, but I did notice that one of the examples from the README does not work.

If I type (range) into a file during autoeval my CPU jumps into high gear, I don't see any evaluted result and I have to manually kill the REPL Java process to recover.

Initially I thought it might be due to Pretty Print, but I tested it with it off as well and it doesn't make a difference. Autoeval seems like a great feature, but I'll need to keep it off if it kills my CPU.

Let me know if you need any additional info about my setup.

JamesMcMahon avatar Nov 24 '16 04:11 JamesMcMahon

Try using (set! *print-length* 50) in your user.clj and see if that resolves the problem. This is something I want to fix. I thought the presence of the ... in the output would break the parsing but that doesn't seem to be the case. I just tried that and it works. I may build this into the proto repl settings if it works out.

jasongilman avatar Nov 24 '16 12:11 jasongilman

Potentially dumb question, where is user.clj?

I checked the README and didn't see a reference to it.

Running (set! *print-length* 50) in the REPL appears to work but does not fix the issue.

JamesMcMahon avatar Nov 24 '16 15:11 JamesMcMahon

user.clj is usually in the dev folder of a Clojure project and used to customize the REPL. See the example one in the Proto REPL demo project.

https://github.com/jasongilman/proto-repl-demo/blob/master/dev/user.clj

Sent from my phone

On Nov 24, 2016, at 10:48 AM, James F McMahon [email protected] wrote:

Potentially dumb question, where is user.clj?

I checked the README and didn't see a reference to it.

Running (set! print-length 50) in the REPL does not seem to fix it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

jasongilman avatar Nov 24 '16 20:11 jasongilman

I haven't had any luck adding dev/user.clj to my own project. It just doesn't get picked up and loaded by the REPL, not sure what I am missing.

When I add (set! *print-length* 50) to the user.clj in the proto-repl-demo project I get the following error:

Exception in thread "main" java.lang.ExceptionInInitializerError
	at clojure.main.<clinit>(main.java:20)
Caused by: java.lang.IllegalStateException: Can't change/establish root binding of: *print-length* with set, compiling:(user.clj:14:1)
	at clojure.lang.Compiler.load(Compiler.java:7391)
	at clojure.lang.RT.loadResourceScript(RT.java:372)
	at clojure.lang.RT.loadResourceScript(RT.java:359)
	at clojure.lang.RT.maybeLoadResourceScript(RT.java:355)
	at clojure.lang.RT.doInit(RT.java:475)
	at clojure.lang.RT.<clinit>(RT.java:331)
	... 1 more
Caused by: java.lang.IllegalStateException: Can't change/establish root binding of: *print-length* with set
	at clojure.lang.Var.set(Var.java:221)
	at user$eval1947.invokeStatic(user.clj:14)
	at user$eval1947.invoke(user.clj:14)
	at clojure.lang.Compiler.eval(Compiler.java:6927)
	at clojure.lang.Compiler.load(Compiler.java:7379)
	... 6 more
Subprocess failed

JamesMcMahon avatar Nov 24 '16 21:11 JamesMcMahon

Adding dev to the path is done in the project.clj of your project. Try cloning the demo project and using that. You can take a look the project.clj there to see how it's done.

I'm not familiar with that error you're seeing. I'm wondering if it has to do with the way your project is setup. See if the demo project works better for you. If it does you can try using some of those settings in your own project.

Sent from my phone

On Nov 24, 2016, at 4:27 PM, James F McMahon [email protected] wrote:

I haven't had any luck adding dev/user.clj to my own project. It just doesn't get picked up and loaded by the REPL, not sure what I am missing.

When I add (set! print-length 50) to the user.clj in the proto-repl-demo project I get the following error:

Exception in thread "main" java.lang.ExceptionInInitializerError at clojure.main.(main.java:20) Caused by: java.lang.IllegalStateException: Can't change/establish root binding of: print-length with set, compiling:(user.clj:14:1) at clojure.lang.Compiler.load(Compiler.java:7391) at clojure.lang.RT.loadResourceScript(RT.java:372) at clojure.lang.RT.loadResourceScript(RT.java:359) at clojure.lang.RT.maybeLoadResourceScript(RT.java:355) at clojure.lang.RT.doInit(RT.java:475) at clojure.lang.RT.(RT.java:331) ... 1 more Caused by: java.lang.IllegalStateException: Can't change/establish root binding of: print-length with set at clojure.lang.Var.set(Var.java:221) at user$eval1947.invokeStatic(user.clj:14) at user$eval1947.invoke(user.clj:14) at clojure.lang.Compiler.eval(Compiler.java:6927) at clojure.lang.Compiler.load(Compiler.java:7379) ... 6 more Subprocess failed — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

jasongilman avatar Nov 24 '16 22:11 jasongilman

Just to clarify, the exception I had about was from the demo project.

Haven't had a chance to do much Clojure lately, I'll get back to this when I get a chance and give you some more info.

JamesMcMahon avatar Dec 11 '16 21:12 JamesMcMahon