More Lists

Something Cool

So Jatha apparently lets you do more than just evaluate LISP queries, it will embed dynamic types and let you call JavaLISP and accomplish the exact same thing as evaluating LISP strings. Here is an implementations of lists using the more arcane side of the API..from here on the verifications tests will attempt to utilize a variety of eval() and direct call where possible.

Java Code

package jathaverify;
import org.jatha.*;
import org.jatha.dynatype.*;
import java.util.*;
public class Main  {

    public Main() {
    }

    public static void main(String[] args) {
        Jatha myLisp  = new Jatha(false, false);
        myLisp.init();
        myLisp.start();

        try {
            LispValue foo1 = myLisp.makeInteger(7);
            LispValue foo2 = myLisp.makeSymbol("Hello");
            LispValue foo3 = myLisp.makeReal(3.14159);
            LispValue foo4 = myLisp.makeList(foo1, foo2, foo3);

            LispValue foo5 = foo4.car();

            System.out.println(foo1);
            System.out.println(foo2);
            System.out.println(foo3);
            System.out.println(foo4);
            System.out.println(foo5);

        } catch (Exception e) {
            System.err.println("LISP Exception: " + e);
        }

    }
}

Java Output (Jatha)

compile:
run:
7
#:Hello
3.14159
(7 #:Hello 3.14159)
7
BUILD SUCCESSFUL (total time: 0 seconds)

Result

Tada!