OK folks. Another Value resolution problem, but this time I can't tell
whether it's our stuff or Jess.

Our system actually runs for awhile, so we're making progress. Here's
the exception:

Jess reported an error in routine Value.Value while executing (batch ./pvc/ces.c
lp).
  Message: Cannot use jess.Value to represent variable _4_pname. You must use cl
ass jess.Variable.
  Program text: ( batch ./pvc/ces.clp )  at line 2.
        at jess.Value.<init>(Compiled Code)
        at jess.Defrule.substFuncall(Compiled Code)
        at jess.Defrule.addPattern(Compiled Code)
        at jess.Jesp.doParseDefrule(Compiled Code)
        at jess.Jesp.parseDefrule(Compiled Code)
        at jess.Jesp.parseSexp(Compiled Code)
        at jess.Jesp.parse(Compiled Code)
        at jess.Batch.call(Compiled Code)
        at jess.FunctionHolder.call(Compiled Code)
        at jess.Funcall.execute(Compiled Code)
        at jess.Jesp.parseAndExecuteFuncall(Compiled Code)
        at jess.Jesp.parseSexp(Compiled Code)
        at jess.Jesp.parse(Compiled Code)
        at jess.Main.execute(Compiled Code)
        at jess.Main.main(Compiled Code)
Jess>

This one *appears* to lie in function batch(), and indeed I thought I'd
found it on line 1869 in Funcall.java:

    String filename = vv.get(1).stringValue(context);

Changing this line to

    String filename = vv.get(1).resolveValue(context).stringValue(context);

however, apparently had no effect. Sigh. I looked for all occurrences
of 'pname' in rule LHSs; each one uses one of our UserFunctions
(oreq), but oreq() is clean (I think):

final class Oreq implements Userfunction {
    public String getName()
    {
        return ("oreq");
    }

    public Value call(ValueVector vec, Context context) throws JessException
    {
        Value rval = Funcall.FALSE;
        Value obj = Resolver.asValue(vec.get(1), context);
        int len = vec.size();

        System.out.println("oreq called...");
        
        for (int i = 2; i < len; i++) {
            if (obj.equals(Resolver.asValue(vec.get(i), context))) {
                rval = Funcall.TRUE;
                break;
            }
        }

        return (rval);
    }
}

So Ernest, is it my system or Jess?

Regards,

-- 
-----------------------------------------------------------------
David E. Young
Fujitsu Network Communications  "The fact that ... we still
([EMAIL PROTECTED])    live well cannot ease the pain of
                                 feeling that we no longer live nobly."
                                  -- John Updike
"Programming should be fun,
 programs should be beautiful"
  -- P. Graham
---------------------------------------------------------------------
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