Arrays

Definition

In LISP, the function make-array makes an array and aref function accesses its elements. All elements of an array are initially set to nil. Jatha appears to validate correctly for arrays.

Common LISP Code

(make-array '(2 3))

Common LISP Output

#2A((NIL NIL NIL) (NIL NIL NIL))

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 {
            List lisp = new ArrayList();
            lisp.add("(make-array '(2 3))");
            Iterator i = lisp.iterator();
            while (i.hasNext()) {
                String query = i.next().toString();
                System.out.println(query + " = " + myLisp.eval(query));
             }

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

    }
}

Java Output (Jatha)

compile:
run:
(make-array '(2 3)) = #2A((NIL NIL NIL) (NIL NIL NIL))
BUILD SUCCESSFUL (total time: 0 seconds)

Result

Awesome!