MCPcopy Index your code
hub / github.com/clojure/clojure / main

Method main

src/jvm/clojure/lang/Compile.java:34–85  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

32private static final Var unchecked_math = RT.var("clojure.core", "*unchecked-math*");
33
34public static void main(String[] args) throws IOException, ClassNotFoundException{
35 RT.init();
36 OutputStreamWriter out = (OutputStreamWriter) RT.OUT.deref();
37 PrintWriter err = RT.errPrintWriter();
38 String path = System.getProperty(PATH_PROP);
39 int count = args.length;
40
41 if(path == null)
42 {
43 err.println("ERROR: Must set system property " + PATH_PROP +
44 "\nto the location for compiled .class files." +
45 "\nThis directory must also be on your CLASSPATH.");
46 System.exit(1);
47 }
48
49 boolean warnOnReflection = System.getProperty(REFLECTION_WARNING_PROP, "false").equals("true");
50 String uncheckedMathProp = System.getProperty(UNCHECKED_MATH_PROP);
51 Object uncheckedMath = Boolean.FALSE;
52 if("true".equals(uncheckedMathProp))
53 uncheckedMath = Boolean.TRUE;
54 else if("warn-on-boxed".equals(uncheckedMathProp))
55 uncheckedMath = Keyword.intern("warn-on-boxed");
56
57 // force load to avoid transitive compilation during lazy load
58 RT.load("clojure/core/specs/alpha");
59
60 try
61 {
62 Var.pushThreadBindings(RT.map(compile_path, path,
63 warn_on_reflection, warnOnReflection,
64 unchecked_math, uncheckedMath));
65
66 for(String lib : args)
67 {
68 out.write("Compiling " + lib + " to " + path + "\n");
69 out.flush();
70 compile.invoke(Symbol.intern(lib));
71 }
72 }
73 finally
74 {
75 Var.popThreadBindings();
76 try
77 {
78 out.flush();
79 }
80 catch(IOException e)
81 {
82 e.printStackTrace(err);
83 }
84 }
85}
86}

Callers

nothing calls this directly

Calls 12

initMethod · 0.95
errPrintWriterMethod · 0.95
internMethod · 0.95
loadMethod · 0.95
pushThreadBindingsMethod · 0.95
mapMethod · 0.95
internMethod · 0.95
popThreadBindingsMethod · 0.95
writeMethod · 0.80
derefMethod · 0.65
invokeMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected