OK, here's what happens: If the first argument to (call) is a string,
Jess first assumes it's a class name, and you're calling a static
method. If the class doesn't exist, it assumes you're trying to call a
method on the given string as a java.lang.String, and does the
implicit conversion. The problem arises if the String
containscharacters that are illegal in a class name: an unexpected
exception is thrown, and the error message Jess produces is rather
cryptic. I would fix this by changing the catch clause at line 251 of
jess/reflect/ReflectFunctions.java from catch (ClassNotFoundException)
to catch (Exception). Indeed, this makes the example work as you'd expect.


I think Ernest Friedman-Hill wrote:
>
> Interesting... some weird parser thing, I'll have a look when I have
> time. For now, realize that this is an abberation due to the
> (implicit) conversion from a Jess 'string' to a java.lang.String
> object. By making the String explicit, you can make the problem go
> away:
> 
> (call (new java.lang.String "+HAHAHA") toLowerCase)
> 
> 
> I think alan littleford wrote:
> > 
> > I'm using Jess 4.1 and am a confused newbie:
> > 
> > Jess> (call "HAHAHA" toLowerCase)
> > "hahaha"
> > 
> > Jess> (call "+HAHAHAHA" toLowerCase)
> > Rete Exception in routine call.
> >   Message: Invalid argument to toLowerCase at line 2:  ( call
> > "+HAHAHAHA" toLowerCase ) .
> > 
> > Since I thought a string was a string was a string the prepended '+'
> > should make no difference, right??
> > 
> > Tnx
> > Alanl
> > 
> > ---------------------------------------------------------------------
> > 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: (510) 294-2154
> Sandia National Labs                FAX:   (510) 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]
> ---------------------------------------------------------------------
> 
> 


---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (510) 294-2154
Sandia National Labs                FAX:   (510) 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]
---------------------------------------------------------------------

Reply via email to