I don't think there's any profound technical reason why this wouldn't
be allowed, but this won't work right now. The deftemplates created by
do-backward-chaining and defclass for need-have will differ in some
internal details, and therefore won't compare equal; Jess won't let
you redefine a deftemplate except in the tricial case where the two
are identical. Note that "defclass need-have" is required because it
sets up some other data structures besides just creating the
deftemplate. 

If you want to experiment with this, you can try commenting out the
line 

                (m_parent == t.m_parent) &&

near line 83 in jess/Deftemplate.java; the error should then go
away. I can't guarantee that Something Bad Won't Happen as a result of
this change.

I think Sander Faas wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hello,
> 
> Is it possible to assert a need- fact with the definstance function? For
> example I have made a deftemplate have, associated with the Java class Have
> and with the do-backward-chaining function I've made also a deftemplate
> need-have. Now I would like to do this:
> 
> (bind ?needhave (new Have))
> (definstance need-have ?needhave dynamic)
> 
> just as I would create a have fact like:
> 
> (bind ?have (new Have))
> (definstance have ?have dynamic)
> 
> Jess gives an error message when I try the first thing :-(
> 
> Bye,
> Sander
> 
> 
> --------------------------------------------------------------------
> 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]
> --------------------------------------------------------------------
> 



---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [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
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to