next up previous

2.6.1 COOL Deviations from a Pure OOP Paradigm

In a pure OOP language, all programming elements are objects which can only be manipulated via messages. In CLIPS, the definition of an object is much more constrained: floatingpoint and integer numbers, symbols, strings, multifield values, externaladdresses, factaddresses and instances of userdefined classes. All objects may be manipulated with messages, except instances of userdefined classes, which must be. For example, in a pure OOP system, to add two numbers together, you would send the message ìaddî to the first number object with the second number object as an argument. In CLIPS, you may simply call the ì+î function with the two numbers as arguments, or you can define messagehandlers for the NUMBER class which allow you to do it in the purely OOP fashion.

All programming elements which are not objects must be manipulated in a nonOOP utilizing function tailored for those programming elements. For example, to print a rule, you call the function ppdefrule; you do not send a message ìprintî to a rule, since it is not an object.


next up previous