Hi Eric,
Non-multivariables are indeed allowed to hold lists, as you
observe; there just never seemed to be any reason to make this
illegal. But that doesn't mean that variables and multivariables (or
slots and multislots) are equivalent. Declaring things one way or the
other effects how patern-matching will be done, and for efficiency
reaosns, the distinction is important; the two types of slots are
treated very differently internally. A serious Jess program can
execute millions of LHS tests in seconds. Even one extra function call or
variable access to determine at runtime whether a slot held a list or
not would make a significant difference (really!)
Anyway, beta won't really be a multislot; it'll be a unislot with a
list in it. You won't be able to pattern-match the members of the list
without explicit multifield method calls.
There are two places (that I can think of right now) in the language
where the distinction between the two types of variables is useful
too: in pattern-matching, of course (a multivariables matches any
number of fields, while a regular one matches exactly one); and in
deffunction argument lists (if the last arg is a multi, then a
variable number of asrguments are allowed.)
I think Eric Eslinger wrote:
>
> Hello list... here's some grist. Using jess 4.4
>
> I can create a template like:
>
> (deftemplate foo (slot alpha) (slot beta))
>
> and assert instances of it easily. Asserting (foo (alpha a) (beta b c
> d)) gives me a nice error, since beta is not a multislot, but if I
> assert (foo (alpha a) (beta (create$ b c d))), I get an instance of foo
> that behaves for all the world as if beta were a multislot. In the same
> vein, I can bind a variable like so (bind ?x (create$ a b c)) without
> error, and again, ?x behaves as if it were really $?x. Was this already
> discussed / fixed somewhere? Maybe there should be no distinction
> between multislots and non.
>
> Anyway...
>
> Eric Eslinger
> [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> in the BODY of a message to [EMAIL PROTECTED], NOT to the
> list. List problems? Notify [EMAIL PROTECTED]
> ---------------------------------------------------------------------
>
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9214 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------