Algernon Software

org.algernon.lang.lisp
Class JathaEvaluator

java.lang.Object
  extended byorg.algernon.lang.lisp.JathaEvaluator
All Implemented Interfaces:
ExternalLanguageEvaluator

public class JathaEvaluator
extends Object
implements ExternalLanguageEvaluator

Evaluator for java method calls and expressions. User: hewett Date: Dec 10, 2002 Time: 4:30:06 PM


Constructor Summary
JathaEvaluator()
           
 
Method Summary
 Object evaluateExpression(LispValue expression, Algernon algy)
          Evaluates a LISP expression.
 Boolean toBoolean(Object any, Algernon algy)
          This method must return a Java Boolean value for any type of Object returned by the evaluateExpression method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JathaEvaluator

public JathaEvaluator()
Method Detail

toBoolean

public Boolean toBoolean(Object any,
                         Algernon algy)
This method must return a Java Boolean value for any type of Object returned by the evaluateExpression method. For example, null might correspond to Boolean.False,

Specified by:
toBoolean in interface ExternalLanguageEvaluator
Parameters:
any - any Java Object, including null.
Returns:
a Java Boolean instance.

evaluateExpression

public Object evaluateExpression(LispValue expression,
                                 Algernon algy)
Evaluates a LISP expression. Jatha contains much of the basic LISP functionality. You can also use defun to define your own functions. Hint: use the :EVAL operator.
   (:TEST (:LISP (> (length ?sequence) 50)))
   (:EVAL (:LISP (print ?x)))
   (:BIND ?x (:LISP (second ?y)))
 

Specified by:
evaluateExpression in interface ExternalLanguageEvaluator
Parameters:
expression - A method call in Java.
Returns:
the object returned by the method. This will always be an instance of LispValue, or null.

Algernon Software