(:BIND ?x 1) (:BIND ?y "14") (:BIND ?z (:JAVA (org.algernon.test.MiscellanyTest.date1))) (:BIND ?w (:LISP (- ?z ?x 14))) (:BIND ?v (:LISP (/ ?x 14))) ;; Sequential Fibonacci (tell ((:BIND ?x1 1) (:BIND ?x2 1) (:PRINTLN ?x1) (:PRINTLN ?x2) (:BIND ?x3 (:LISP (+ ?x1 ?x2))) (:PRINTLN ?x3) (:BIND ?x1 ?x2) (:BIND ?x2 ?x3) (:BIND ?x3 (:LISP (+ ?x1 ?x2))) (:PRINTLN ?x3) (:BIND ?x1 ?x2) (:BIND ?x2 ?x3) (:BIND ?x3 (:LISP (+ ?x1 ?x2))) (:PRINTLN ?x3) (:BIND ?x1 ?x2) (:BIND ?x2 ?x3) (:BIND ?x3 (:LISP (+ ?x1 ?x2)))))
Unlike earlier versions of Algernon, a variable can be bound more than once. If reasoning branches before the :BIND command, each reasoning branch will have a separate copy of the variable. In that case, the :BIND command will only affect the copy of the variable in the current reasoning branch.
See also the syntax for calling external functions.