next up previous

2.1.1 Top Level Commands

The primary method for interacting with CLIPS in a nonembedded environment is through the CLIPS command prompt (or top level). When the ìCLIPS>î prompt is printed, a command may be entered for evaluation. Commands may be function calls, constructs, global variables, or constants. If a function call is entered (see section 2.3.2), that function is evaluated and its return value is printed. Function calls in CLIPS use a prefix notationóthe operands to a function always appear after the function name. Entering a construct definition (see section 2.3.3) at the CLIPS prompt creates a new construct of the appropriate type. Entering a global variable (see section 2.4.3) causes the value of the global variable to be printed. Entering a constant (see section 2.3.1) at the top level causes the constant to be printed (which is not very useful). For example,

         CLIPS (V6.0 05/11/93)
CLIPS> (+ 3 4)
7
CLIPS> (defglobal ?*x* = 3)
CLIPS> ?*x*
3
CLIPS> red
red
CLIPS>

The previous example first called the addition function adding the numbers 3 and 4 to yield the result 7. A global variable ?*x* was then defined and given the value 3. The variable ?*x* was then entered at the prompt and its value of 3 was returned. Finally the constant symbol red was entered and was returned (since a constant evaluates to itself).


next up previous