source: branches/streams/abcl/examples/java-to-lisp-1/Main.java

Last change on this file was 12307, checked in by ehuelsmann, 15 years ago

Complete "catch (Throwable" review by reviewing ../examples.

  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1/*
2 * Main.java
3 *
4 * Copyright (C) 2008 Ville Voutilainen
5 * $Id: Main.java 12307 2009-12-25 21:54:31Z ehuelsmann $
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20 */
21
22import org.armedbear.lisp.*;
23
24public class Main
25{
26    /**
27     * This example creates an Interpreter instance, loads our
28     * lisp code from a file and then evaluates a function defined
29     * in the loaded lisp file.
30     */
31    public static void main(String[] argv)
32    {
33  try
34      {
35    Interpreter interpreter = Interpreter.createInstance();
36    interpreter.eval("(load \"lispfunction.lisp\")"); 
37    LispObject myInterface = interpreter.eval("(lispfunction)");
38      }
39  catch (Throwable t)
40      {
41    System.out.println("exception!");
42    t.printStackTrace();
43      }
44    }
45}
Note: See TracBrowser for help on using the repository browser.