This preview shows page 1. Sign up to view the full content.
Unformatted text preview: and rules. 3.6. Calling functions As in Lisp, all code in Jess ( control structures , assignments , procedure calls) takes the form of a function call. There are no "operators"; everything is a function call. However, some functions have names that look like Java operators, and in these cases, they operate much like their Java counterparts. Function calls in Jess are simply lists . Function calls use a prefix notation; a list whose head is a symbol that is the name of an existing function can be a function call. For example, an expression that uses the + function to add the numbers 2 and 3 would be written (+ 2 3) . When evaluated, the value of this expression is the number 5 (not a list containing the single element 5 !). In general, expressions are recognized as such and evaluated in context when appropriate. You can type expressions at the Jess> prompt. Jess evaluates the expression and prints the result: Jess> (+ 2 3) 5 Jess> (+ (+ 2 3) (* 3 3)) 14...
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