Calling External Functions

Java

To call a static function in Java:
  (:EVAL (:JAVA (com.foo.myPackage.Humor.generateJoke ?man ?animal)))
To call a non-static function in Java:
  (:BIND ?x (:JAVA (toString 5)))
  (:EVAL (:JAVA (getColor ?object)))

Argument type conversion between Algernon and Java

Internally, Algernon represents values using a set of classes for dynamically-typed data. When converting to Java, it picks the most appropriate class. The table below shows the mapping of internal types to external types and vice versa.
Java Algernon
Boolean true=T, false=NIL
Double LispFloat
Long LispInteger
String All other types

LISP

Algernon contains a built-in LISP subsystem called Jatha that contains many of the standard Common LISP functions. It is useful for performing many common processing tasks.
  (:BIND ?x (:LISP (- ?value 5)))
  (:EVAL (:LISP (cons ?x ?y)))
  (:TEST (:LISP (> ?x 19)))

Back to...

Algernon commands
Algernon Documentation Central
Algernon home page