Hi,
Jess uses a kind of SmallTalk-like very-late-binding model for working with
objects. Object variables don't really have types at all; Jess will
simply try to call the method you want and throw an exception if it
doesn't exist. So to accomplish the below, you can simply write
(bind ?args (create$ foo bar))
(bind ?orb (call org.omg.CORBA.ORB init ?args nil))
(bind ?boa (call orb BOA_init))
and if ?orb actually points to an object with a BOA_init method, it
will be called.
I think Rudolph George-P27574 wrote:
>
> The particular scenario I was thinking of has to do with Java 2 & Visbroker
> 3.4 compatibility, where to use certain methods, a cast of the following
> kind is required:
>
> org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null);
> org.omg.CORBA.BOA boa = ((com.visigenic.vbroker.orb.ORB)
> orb.BOA_init();
>
> What I wanted to do is implement this code in Jess where I need a reference
> to the ORB and the BOA to do some things. I have two motivations for doing
> this:
> 1) I want to use these in a rule base, and
> 2) If I use Jess as a "scripting language", then it seems like I'd want to
> know how to do this kind of thing in general.
>
> My real goal is to get references to the ORB and BOA that I can use inside
> Jess, so I have considered that an approach mixing Java and Jess should work
> as well, if that's the "best", or only, way to do it.
>
>
>
> -----Original Message-----
> From: Ernest Friedman-Hill [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 22, 1999 7:09 AM
> To: George.Rudolph
> Cc: [EMAIL PROTECTED]
> Subject: Re: JESS: How to do a Java class cast in Jess?
>
>
>
> You shouldn't need to do a cast anywhere, since everything in Jess is
> done dynamically. But since you're asking, perhaps you've found a
> situation where it's necessary. If so, can you describe this scenario?
>
> I think Rudolph George-P27574 wrote:
> >
>
> ---------------------------------------------------------
> 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 (use your own address!) List problems? Notify
> [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 (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 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 (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------