Re: JESS: [EXTERNAL] Adding facts that are instances of from-class deftemplates
"Henrique Lopes Cardoso" <[email protected]> Tue, 21 May 2013 15:32:23 +0100
| Newsgroups | gmane.comp.java.jess |
|---|---|
| Message-ID | <CALLS5+B-1R_fyhkWGUBd4-x2kADvWpgpsHCqS45TXazZcHG7QA@mail.gmail.com> |
--089e015372084aac9204dd3b519c Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=iso-8859-1 Got that, thanks a lot. Henrique On Thu, May 16, 2013 at 3:24 PM, Friedman-Hill, Ernest <[email protected]>wrote: > The thing is that after this code: > > (deftemplate Person (declare (from-class Person))) > (bind ?f (assert (Person (name "Henrique") (age 38)))) > > There's no way to transfer those property values to a Person object; i.e., > if you then said > > (modify ?f (OBJECT (new Person))) > > Then the Person's name and age would NOT be "Henrique" and "38"; they'd be > something else. The only way to get a shadow fact and a Java object synced > up automatically is to let Jess copy the properties to the fact from the > object. > > > > > > > -------------------------------------------------------------------- > 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]. > -------------------------------------------------------------------- > > -- ----- - - - - - - - - - - - - Henrique Lopes Cardoso DEI/FEUP Rua Dr. Roberto Frias | 4200-465 Porto PORTUGAL VoIP: (+351) 220413355 Phone: (+351) 225081400 [email protected] | www.fe.up.pt/~hlc ----- - - - - - - - - - - - - --089e015372084aac9204dd3b519c Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Got that, thanks a lot.<div><br></div><div>Henrique</div><div><br></div><di= v><br><br><div class=3D"gmail_quote">On Thu, May 16, 2013 at 3:24 PM, Fried= man-Hill, Ernest <span dir=3D"ltr"><<a href=3D"mailto:[email protected]= " target=3D"_blank">[email protected]</a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex">The thing is that after this code:<br> <div class=3D"im"><br> =A0 (deftemplate Person (declare (from-class Person)))<br> </div>=A0 (bind ?f (assert (Person (name "Henrique") (age 38))))<= br> <br> There's no way to transfer those property values to a Person object; i.= e., if you then said<br> <br> (modify ?f (OBJECT (new Person)))<br> <br> Then the Person's name and age would NOT be "Henrique" and &q= uot;38"; they'd be something else. The only way to get a shadow fa= ct and a Java object synced up automatically is to let Jess copy the proper= ties to the fact from the object.<br> <br> <br> <br> <br> <br> <br> --------------------------------------------------------------------<br> To unsubscribe, send the words 'unsubscribe jess-users <a href=3D"mailt= o:[email protected]">[email protected]</a>'<br> in the BODY of a message to <a href=3D"mailto:[email protected]">majordo= [email protected]</a>, NOT to the list<br> (use your own address!) List problems? Notify <a href=3D"mailto:owner-jess-= [email protected]">[email protected]</a>.<br> --------------------------------------------------------------------<br> <br> </blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><pre cols=3D= "72">----- - - - - - - - - - - - -</pre><pre cols=3D"72">Henrique = Lopes Cardoso DEI/FEUP Rua Dr. Roberto Frias | 4200-465 Porto PORTUGAL VoIP: (+351) 220413355 Phone: (+351) 225081400 ext.1315 <a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a> | <a hre= f=3D"http://www.fe.up.pt/~hlc" target=3D"_blank">www.fe.up.pt/~hlc</a> ----- - - - - - - - - - - - -</pre> </div> --089e015372084aac9204dd3b519c--