Basic commands in JESS

Jess is a case sensitive language, which supports one-line comments in the Lisp style, and multi-line as in C.

;One-line comment

/*

multi-line

*/

You need to pay attention to the brackets, you must also do the intervals between successive expressions in brackets - examples are shown below:

(batch name.clp)

It allows you to load into the console source code file - name.clp.

(printout t "napis" crlf)

Writes the string contained between " "

(bind ?a 5)

Adding a new local variable and set value 5

(printout t "zmienna a ma wartosc" ?a crlf)

Print the value of variable a.

( + 2 5)

Example of arithmetic operations, you can select a different action (+, -, *, /)

(* (+ 2 5) (- 10 5))

Kolejność wykonywania operacji jest zachowana, mnożenie wykona się na końcu.

It is worth remembering that the command can be combined. Often in one line of code you can perform several operations, and I recommend to use it. When you get familiarity with the language, code created in this way will be much easier to read.

(bind ?a (- 13 10))
(bind ?b (+ 2 2))
(* ?a ?b)

Jess language may look quite complicated at first, but after some time communing with it the implementation of logical rules is quick and takes small amount of code. Symbols are the main core of the language contained in numbers (names may not start from them), letters and characters:

$*=+/<>_?#