This preview shows page 1. Sign up to view the full content.
Unformatted text preview: while is a boolean expression. The while function evaluates its first argument and, if it is true, evaluates all its other arguments. It repeats this procedure until the first argument evaluates to FALSE ; a while loop always returns FALSE. There are several other looping functions built into Jess; see the descriptions of for and foreach in the Jess function index. There is also a break function that can be used to abort loops as well as return early from the right-hand-side of a rule. 3.8.2. Decisions and branching The if function looks like this: Jess> (bind ?x 1) 1 Jess> (if (> ?x 100) then (printout t "X is big" crlf) elif (> ?x 50) then (printout t "X is medium" crlf) else (printout t "X is small" crlf))...
View Full Document
This note was uploaded on 03/02/2010 for the course COMP 102 taught by Professor Smith during the Spring '10 term at California State University , Monterey Bay.
- Spring '10