The distinction between a (slot s) and a (multislot m) is that
the former can hold a single value and the latter a list. Jess
enforces this by the Jess parser accepting just a single expression
for slots, as opposed to a list of expressions for multislots.

Therefore the following construct where s is not a multislot
is accepted:
   (deffacts x (temp (s (list 1 2 3))))

The resulting fact, however, is
   (temp (s 1))
The tail of the list is lost without a diagnostic.

In the case of
   (deffacts x (temp (s (list))))
there is a diagnostic when (reset) is executed, with an index 0
out of bounds exception which is nicely traced back through
"(reset)" and "assert from deffacts x" (although it does not
name the template and slot).

Perhaps an assertion that the vector has length 1 would cover
all contigencies.

Wolfgang

Reply via email to