rlm@10: /** rlm@10: * Copyright (c) Rich Hickey. All rights reserved. rlm@10: * The use and distribution terms for this software are covered by the rlm@10: * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) rlm@10: * which can be found in the file epl-v10.html at the root of this distribution. rlm@10: * By using this software in any fashion, you are agreeing to be bound by rlm@10: * the terms of this license. rlm@10: * You must not remove this notice, or any other, from this software. rlm@10: **/ rlm@10: rlm@10: package clojure; rlm@10: rlm@10: import clojure.lang.Symbol; rlm@10: import clojure.lang.Var; rlm@10: import clojure.lang.RT; rlm@10: rlm@10: public class main{ rlm@10: rlm@10: final static private Symbol CLOJURE_MAIN = Symbol.intern("clojure.main"); rlm@10: final static private Var REQUIRE = RT.var("clojure.core", "require"); rlm@10: final static private Var LEGACY_REPL = RT.var("clojure.main", "legacy-repl"); rlm@10: final static private Var LEGACY_SCRIPT = RT.var("clojure.main", "legacy-script"); rlm@10: final static private Var MAIN = RT.var("clojure.main", "main"); rlm@10: rlm@10: public static void legacy_repl(String[] args) throws Exception{ rlm@10: REQUIRE.invoke(CLOJURE_MAIN); rlm@10: LEGACY_REPL.invoke(RT.seq(args)); rlm@10: } rlm@10: rlm@10: public static void legacy_script(String[] args) throws Exception{ rlm@10: REQUIRE.invoke(CLOJURE_MAIN); rlm@10: LEGACY_SCRIPT.invoke(RT.seq(args)); rlm@10: } rlm@10: rlm@10: public static void main(String[] args) throws Exception{ rlm@10: REQUIRE.invoke(CLOJURE_MAIN); rlm@10: MAIN.applyTo(RT.seq(args)); rlm@10: } rlm@10: }