Booleans

Definition

Booleans are simple enough to validate...especially in LISP since the self-evaluating symbol nil is false and anything other than nil means true. The self-evaluating symbol t stands for true.

Common LISP Code

(t 4 5)
(t 4 NIL)

Common LISP Output

4
4

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("(if t 4 5)");
            lisp.add("(if t 4 NIL))");

            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:
(if t 4 5) = 4
(if t 4 NIL)) = 4
BUILD SUCCESSFUL (total time: 0 seconds)

Result

Awesome!