Hi Ernest.

Since I'm apparently the guilty party responsible for the code in 
question, I can confirm your recollection of events concerning 
Multifunctions.  

If I recall correctly, the equals method was not available at the time 
(I think I may have mentioned this to you in other correspondence) so I 
made what is essentially a hack.  Appending the data type made it easy 
to differentiate objects that had equivalent string representations from 
toString().

Win Carus

>From [EMAIL PROTECTED] Sun Feb 14 20:02:07 1999
>Received: from [132.175.109.1] by hotmail.com (1.1) with SMTP id 
MHotMailB890E73C46B8DD101709584AF6D01D8520; Sun Feb 14 20:02:07 1999
>Received: by sass165.sandia.gov (8.9.1a/8.9.1a) id UAA19760
>       for jess-users-outgoing; Sun, 14 Feb 1999 20:32:49 -0700 (MST)
>X-Authentication-Warning: sass165.sandia.gov: majordom set sender to 
[EMAIL PROTECTED] using -f
>Received: from herzberg.ca.sandia.gov (herzberg.ca.sandia.gov 
[146.246.245.226])
>       by sass165.sandia.gov (8.9.1a/8.9.1a) with ESMTP id UAA19755
>       for <[EMAIL PROTECTED]>; Sun, 14 Feb 1999 20:32:46 -0700 (MST)
>Received: (from ejfried@localhost) by herzberg.ca.sandia.gov 
(8.8.0/8.8.0) id TAA06324 for [EMAIL PROTECTED]; Sun, 14 Feb 1999 
19:30:52 -0800 (PST)
>From: Ernest Friedman-Hill <[EMAIL PROTECTED]>
>Message-Id: <[EMAIL PROTECTED]>
>Subject: Re: JESS: comparison operations on external addresses
>To: [EMAIL PROTECTED]
>Date: Sun, 14 Feb 1999 19:30:52 -0800 (PST)
>In-Reply-To: <[EMAIL PROTECTED]> from "Bob Orchard" at Feb 
13, 99 07:55:19 pm
>X-Mailer: ELM [version 2.4 PL23]
>MIME-Version: 1.0
>Content-Type: text/plain; charset=US-ASCII
>Content-Transfer-Encoding: 7bit
>Content-Transfer-Encoding: 7bit
>Sender: [EMAIL PROTECTED]
>Reply-To: [EMAIL PROTECTED]
>Content-Transfer-Encoding: 7bit
>
>
>Hi Folks,
>
>One of my many failings is that I have a tendency to feel squeamish
>about making changes to user-contributed code - it is, in my way of
>thinking, an example of "looking a gift horse in the mouth." That
>said, it should be obvious from the comments in Multifunctions.java
>that much of the code in that file was a gift - a rather old one, at
>that: it was first included in Jess 3.1.
>
>Looking now at the functions for subsetp, union$, intersection$, and
>complement$, I'm at a loss to explain the choice of algorithm. Jess
>has changed a lot since then, and perhaps at the time these were
>written, converting to strings and comparing the strings was the only
>way to accomplish the task, but at the present time, the
>Value.equals() method would serve much better. Note that at the time
>of Jess 3.1, EXTERNAL_ADDRESS values may not yet have ever been used
>by anyone, although the constant was defined.
>
>I'll delay 5,0a3 by another day and rewrite these questionable
>functions before the releae. Thanks for pointing these out.
>
>I think Bob Orchard wrote:
>> 
>> Take a look at the code in MultiFinctions.java and you'll see that to
>> do the subsetp test the Values of the list are converted to strings
>> with ToString and the type is appended to this string. These strings
>> are used to compare and determine 'equality'. This probably works
>> most of the time but external addresses (i.e. Objects like 
StringBuffer)
>> convert to string as "External-Address:objectname". This means that
>> for objects, all those of the same class are considered to be the 
same.
>> I think this may be intentional (for performance perhaps),but I also
>> think it should be done as you say via equals.
>> 
>> Bob.
>> 
>> Bob Johnson wrote:
>> 
>> > Fellow Jessians,
>> >
>> > I need to populate multislots with Java objects and subsequently
>> > perform multislot set comparisons. I was assuming that all
>> > comparisons on external addresses would be accomplished via the 
Java
>> > "public boolean equals(Object obj)" method. The following 
interaction
>> > seems to prove otherwise:
>> >
>> > 
----------------------------------------------------------------------
>> > Jess, the Java Expert System Shell
>> > Jess Version 4.3 12/3/98
>> >
>> > Output appears in this window.
>> > Type your input in the one-line input box below.
>> > Jess> (defglobal ?*buffa* = (new java.lang.StringBuffer "a"))
>> > TRUE
>> > Jess> (defglobal ?*buffb* = (new java.lang.StringBuffer "b"))
>> > TRUE
>> > Jess> (subsetp (create$ ?*buffa*) (create$ ?*buffb*))
>> > TRUE
>> > Jess> (subsetp (create$ "a") (create$ "b"))
>> > FALSE
>> > Jess> (call ?*buffa* toString)
>> > "a"
>> > Jess> (call ?*buffb* toString)
>> > "b"
>> > Jess> (call ?*buffa* equals ?*buffb*)
>> > FALSE
>> > Jess>
>> > 
----------------------------------------------------------------------
>> >
>> > Am I expecting something that I shouldn't or is this a bug?
>> >
>> >         Regards,
>> >
>> >         Bob
>> >
>> > 
---------------------------------------------------------------------
>> > To unsubscribe, send the words 'unsubscribe jess-users 
[EMAIL PROTECTED]'
>> > in the BODY of a message to [EMAIL PROTECTED], NOT to the
>> > list. 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. 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. List problems? Notify [EMAIL PROTECTED]
>---------------------------------------------------------------------


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to