I think Luca Bascetta wrote:
> 
> How can I use static variables as function arguments?
> For example if I want to call a java function like this:
> 
> public void foo(Color col)
> 
> the statement (call foo java.awt.Color.red) doesn't work.

Hi Luca, 

It'll work, you're just not doing it quite the right way.

The first argument to 'call' is the object or classname through which to
call the function; the second argument is the function name; and the
rest are arguments; so you've got that slightly wrong; you probably
meant to write

(call ?obj foo java.awt.Color.red)

Anyhow. To pass the static variable as an argument, you have to
'retrieve' it, as if you were assigning it to a variable. The
'get-member' function does this. So all together, something like

(call ?obj foo (get-member java.awt.Color red))

will do what you want.

> Thank you.
> 
> Luca Bascetta
> [EMAIL PROTECTED]
> 
> ICQ# 9105513


---------------------------------------------------------
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