At 12:06 24/09/2001, ejfried wrote:
>You can use template inheritance: define a template has-a-and-b, then
>let foo and baz extend it. Then write the pattern as
>You only get single inheritance, but you can have multiple levels of
>inheritance. There could be a (has-a) template that both
>(has-a-and-b) and (bar) extend.
Unfortunately, I'd need multiple inhgeritance. My bad for not fully
explaining that the templates are already part of a heirarchy and are
inconveniently complicated.
>I'm thinking about having meta-templates in Jess 7, which might let
>you write something like
>
>(defrule findB
> (?head (A ?id) (B value))
> =>
> (do something))
>
>with your original set of templates, without using inheritance.
hmm. This is exactly what I was hoping to do now.
I guess I'll carry on with the verbose use of or for now.
> > (defrule findB
> > (or
> > (foo (A ?id) (B ?b))
> > (baz (A ?id) (B ?b))
> > )
> > (test (eq ?b value))
> > =>
> > (do something)
> > )
cheers all
Rob.
--
British Maritime Technology
Tel: +44 (0)20 8943 5544
Fax: +44 (0)20 8977 9304
WWW: http://www.bmtech.co.uk
IMPORTANT: Any views or opinions expressed are solely those of the author
and do not necessarily represent those of British Maritime Technology.
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------