<< Back to previous view

[CLJCLR-5] Global vars set! by the init script is reset to original state by Clojure.Main.exe Created: 16/Dec/12  Updated: 12/Mar/13  Resolved: 12/Mar/13

Status: Resolved
Project: ClojureCLR
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Shantanu Kumar Assignee: David Miller
Resolution: Declined Votes: 0
Labels: None

.NET 4.0 Clojure 1.4.0 on Windows 7


I start the repl and run my ClojureCLR as follows:

Clojure.Main.exe -i initscript -r
Clojure.Main.exe -i initscript -m foo.core

The file initscript looks like this:

(set! *warn-on-reflection* true)

The value set in the initscript is not carried over to the repl or run session. When I embed the line

(set! *warn-on-reflection* true)
into the target Clojure file, the newly set value is recognized.

Comment by David Miller [ 12/Mar/13 8:36 AM ]

This behavior comes from the JVM version of Clojure. Request for change should happen there.

This happens because the initialization is done by a call to Compiler.loadFile, which calls Compiler.load which establishes its own binding for warn-on-reflection, that binding disappearing when the initialization is complete.

Generated at Sun Oct 22 19:55:14 CDT 2017 using JIRA 4.4#649-r158309.