Well, I guess we should all vote on this?  Class type (wrapper) returns are 
much preferred to basic types.  It's about the same traffic either way since a 
basic type size is about equal to a pointer to an object.  (About!)  And, I can 
always convert from a Class to a basic type if necessary.  Objects also have 
other methods not associated with basic data types.  

As a matter of fact, at one time the Java committee considered not even having 
basic data types because, as they said, a true OO language is composed of 
Objects only, not basic data types.  Personally, I'm glad that they left them 
in for us old, retarded C/C++ guys who would probably still be using Assembler 
if development / debugging time wasn't so slow.  :-)


>Hi Michael,
>
>I can confirm this behaviour in Jess 6, too.  It's actually not just
>field access, but method return values too -- i.e., the return value
>of a method returning Integer would be similarly converted.
>
>It is arguably incorrect for this conversion to be done at all; I'm
>not sure what I was thinking when I defined it this way. I believe the
>current behaviour was influenced by user comments on the behviour of
>Java Strings. Several people expressed the opinion that a method
>returning String should return a Jess string when called from Jess,
>not an external address with a Java String in it.
>
>Let me throw this one out for comment. If you call a method or fetch a
>field of type Integer (or Float, or Double, or Boolean) should it
>return the primitive type in Jess, as it does now, or should it return
>the wrapper object? What do people think?
>
>
>I think Lucero, Michael wrote:
>[Charset iso-8859-1 unsupported, filtering to ASCII...]
>> Using Jess 5.1:
>> 
>> if I have a class like this:
>> 
>> public class A
>> {
>>      public final static Object VAR = new Integer(1);
>> 
>>      public void setValueById(Object id)
>>      {
>>              m_val = id;
>>             }
>> 
>>      private Object m_val,
>> }
>> 
>> and rules (forgive syntax errors):
>> 
>> (defclass classA A)
>> 
>> (defRule varTest
>>      (classA (OBJECT ?o))
>> =>
>>      (call ?o setValueById (get-member A VAR))
>> )
>> 
>> I get an exception when the rule fires:
>>   Message: No overloading of method 'setValueById' in class A I can call
>> with these arguments: (call ?o setValueById (get-member A VAR)).
>> 
>> I think the problem here is that 'get-member' does not return an external
>> address, but has translated it to a Jess Integer type.
>> 
>> Is this expected, and, if so, is there a way to prevent that automatic
>> translation.
>> 
>> Thanks in advance
>> 
>> Michael Lucero
>> ---------------------------------------------------------------------
>> 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 owner-jess-
[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]
>---------------------------------------------------------------------
>


IHN
jco

James C. Owen
Senior Knowledgebase Consultant
KnowledgeBased Systems Corporation
6314 Kelly Circle
Garland, TX   75044
972.530.2895

mailto:[EMAIL PROTECTED]
http://www.kbsc.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]
---------------------------------------------------------------------

Reply via email to