Hi, Ernest,
I am sorry when I got the error I assumed that the problem was
with the jess variable. Now I have known where the problem is.
Actually, there is nothing wrong with the jess variable.
I think the multivariable argument passing in Jess5.0a5 is a
little different from Jess5.0a4.
Let us consider the jess program:
(deffunction builds (?n $?rodes)
(bind ?s (new java.lang.String "ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
(foreach ?x $?rodes
(printout t ?x (call ?s indexOf ?x) crlf)))
(defrule r1
=>
; (builds 1 A B C)
(bind $?rr_nodes (create$ A B C))
(builds 1 $?rr_nodes)
)
In Jess5.0a5, the argument list of function builds should be
written as (?n ?rodes). While in Jess5.0a4, (?n $?rodes) works
as well as (?n ?rodes).
Thank you.
Ning
>From: "Ernest Friedman-Hill" <[EMAIL PROTECTED]>
>Reply-To: <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>CC: <]@herzberg1.ca.sandia.gov>
>Subject: Re: JESS: jess variables in Jess 5.0a5
>Date: Mon, 7 Jun 1999 06:17:22 -0700 (PDT)
>
>Hi,
>
>You'd have to tell us what the error is exactly. For example, the
>following code seems analagous to what you've provided, but it works
>fine:
>
>
>c:/users/root> java jess.Main
>
>Jess, the Java Expert System Shell
>Copyright (C) 1998 E.J. Friedman Hill and the Sandia Corporation
>Jess Version 5.0a5 5/27/99
>
>Jess> (bind ?s (new java.lang.String "ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
><External-Address:java.lang.String>
>Jess> (deffunction builds (?n $?rodes)
> (foreach ?x $?rodes
> (bind ?code (call ?s indexOf ?x))))
>TRUE
>Jess> (builds 1 A B C)
>2
>Jess>
>
>
>(The astute reader will notice that ?s is not a defglobal. In Jess50a5
>you can bind ordinary local variables at the global scope. Makes
>experimenting at the keyboard much easier!)
>
>
>
>I think Ning Zhong wrote:
> >
> > Dear jess users,
> >
> > I have written one jess function:
> >
> > (deffunction builds (?n $?rodes)
> >
> > (foreach ?x $?rodes
> >
> > (bind ?code (call ?*model* get_od ?x))
> > )
> > )
> >
> > $?rodes is a multifield variable.
> > The method get_od take a String object as its argument.
> > I got no error when I run this function in Jess5.0a4.
> > How if I run it in JESS5.0a5. It produce an error when calling
> > the method get_od. The variable ?x is not treated as a string
> > in Jess5.0a5, while in Jess5.0a4 it is.
> > Is that we can no longer treat an atom as a string?
> >
> > Thanks in advance,
> >
> > Ning
> >
> >
> > ______________________________________________________
> > 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]
> > ---------------------------------------------------------------------
> >
> >
>
>
>---------------------------------------------------------
>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]
---------------------------------------------------------------------