I think [EMAIL PROTECTED] wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi all,
> 
> I have a package DateFunctions conatining 'class Before implements Userfunction'. 
>Inside 'Before' I expect two instances of GregorianCalendar and simply call 
>GregorianCalendar.before() on them.
> 
> To use it from jess, as I understand, I will have to 
> create two instances of java.util.GregorianCalendar in jess using
> 
> (bind ?dt1 (new java.util.GregorianCalendar))
> (bind ?dt1 (new java.util.GregorianCalendar))
> 
> and call  (before dt1 dt2)

Well, yes; you don't have to create the two instances this way, of
course. They could come from outside of Jess, or be returned by a
function call, etc.

> 
> My question is, when these instances dt1 and dt2 are converted to Value, are they of 
>type RU.ATOM or RU.EXTERNAL_ADDRESS. What do these types represent.

An RU.EXTERNAL_ADDRESS Value holds a Java object; an RU.ATOM holds a
symbol. Any values that hold a GregorianCalendar are going to be
RU.EXTERNAL_ADDRESS values.

> 
> Will things be any diffrent if I went the java route and did a 
> new GregorianCalendar() followed by rete.definstance() and rete.executecommand(" 
>(before dt1 dt2)")
> 

definstance() is used to enable pattern-matching on Java Beans from
rule LHSs; it's not relevant here. But let me answer your question by
rephrasing it: would things be any different if you did

GregorianCalendar dt1 = new GregorianCalendar();
GregorianCalendar dt2 = new GregorianCalendar();
rete.store("dt1", dt1);
rete.store("dt2", dt2);
rete.executeCommand("(before (fetch dt1) (fetch dt2))");

The answer is no, this is no different; this would work just the same
as your previous example.


> Thanks very much.
> 
> Dheeraj
> 
> 
> 
> 
> __________________________________________________________________
> Your favorite stores, helpful shopping tools and great gift ideas. Experience the 
>convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/
> 
> Get your own FREE, personal Netscape Mail account today at 
>http://webmail.netscape.com/
> 
> 
> ---------------------------------------------------------------------
> 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