view src/clojure/main.java @ 10:ef7dbbd6452c

added clojure source goodness
author Robert McIntyre <rlm@mit.edu>
date Sat, 21 Aug 2010 06:25:44 -0400
parents
children
line wrap: on
line source
1 /**
2 * Copyright (c) Rich Hickey. All rights reserved.
3 * The use and distribution terms for this software are covered by the
4 * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
5 * which can be found in the file epl-v10.html at the root of this distribution.
6 * By using this software in any fashion, you are agreeing to be bound by
7 * the terms of this license.
8 * You must not remove this notice, or any other, from this software.
9 **/
11 package clojure;
13 import clojure.lang.Symbol;
14 import clojure.lang.Var;
15 import clojure.lang.RT;
17 public class main{
19 final static private Symbol CLOJURE_MAIN = Symbol.intern("clojure.main");
20 final static private Var REQUIRE = RT.var("clojure.core", "require");
21 final static private Var LEGACY_REPL = RT.var("clojure.main", "legacy-repl");
22 final static private Var LEGACY_SCRIPT = RT.var("clojure.main", "legacy-script");
23 final static private Var MAIN = RT.var("clojure.main", "main");
25 public static void legacy_repl(String[] args) throws Exception{
26 REQUIRE.invoke(CLOJURE_MAIN);
27 LEGACY_REPL.invoke(RT.seq(args));
28 }
30 public static void legacy_script(String[] args) throws Exception{
31 REQUIRE.invoke(CLOJURE_MAIN);
32 LEGACY_SCRIPT.invoke(RT.seq(args));
33 }
35 public static void main(String[] args) throws Exception{
36 REQUIRE.invoke(CLOJURE_MAIN);
37 MAIN.applyTo(RT.seq(args));
38 }
39 }