From: <cl...@br...> - 2008-02-15 11:08:29
Attachments:
smime.p7s
|
Dear colleagues, porting a Drools semantic (rules definition language) into a Jython code. The code throws a syntax error at the following line: TRUE = 1 FALSE = 0 .. self.salience = 30 self.no-loop = TRUE Error: Syntax error can´t assign to operator. Looks like the Jython acts like a Python interpreter, rejecting the right side of the assignment statement, thinking "self.no-loop" is an expression. Indeed inside Java DRL, the "no-rule" is an attribute, like this <rule name="rule1" salience="30" no-rule="true"> Any idea how to fix the syntax error? Regards, Claude Claude Falbriard Developer AMS Hortolândia / SP - Brazil phone: +55 13 8126 7787 cell: +55 13 8117 3316 e-mail: cl...@br... |
From: Alan K. <jyt...@xh...> - 2008-02-15 12:08:07
|
[Claude] > self.no-loop = TRUE > > Error: Syntax error can´t assign to operator. > > Looks like the Jython acts like a Python interpreter, rejecting the right > side of the assignment statement, thinking "self.no-loop" is an expression. > Indeed inside Java DRL, the "no-rule" is an attribute, like this <rule > name="rule1" salience="30" no-rule="true"> "no-rule" is not a valid python identifier; it contains the "-" operator, and so is interpreted as an expression, like so self.no - loop = TRUE Use "_" instead; you should have no problem with the following self.no_loop = TRUE HTH, Alan. |
From: Jeff E. <jem...@fr...> - 2008-02-15 16:04:08
|
Maybe setattr(self,'no-loop',TRUE) cl...@br... wrote: > Dear colleagues, > > porting a Drools semantic (rules definition language) into a Jython code. > The code throws a syntax error at the following line: > > TRUE = 1 > FALSE = 0 > .. > self.salience = 30 > self.no-loop = TRUE > > Error: Syntax error can´t assign to operator. > > Looks like the Jython acts like a Python interpreter, rejecting the right > side of the assignment statement, thinking "self.no-loop" is an > expression. > Indeed inside Java DRL, the "no-rule" is an attribute, like this <rule > name="rule1" salience="30" no-rule="true"> > > Any idea how to fix the syntax error? > > Regards, > Claude > > Claude Falbriard > Developer > AMS Hortolândia / SP - Brazil > phone: +55 13 8126 7787 > cell: +55 13 8117 3316 > e-mail: cl...@br... > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: <cl...@br...> - 2008-02-15 16:36:18
Attachments:
smime.p7s
|
Dear Jeff, setattr(self,'no-loop',TRUE) The Jython interpreter did accept it as a valid syntax. That hint was really ZEN ! Thanks. Regards, Claude Claude Falbriard Developer AMS Hortolândia / SP - Brazil phone: +55 13 8126 7787 cell: +55 13 8117 3316 e-mail: cl...@br... Jeff Emanuel <jem...@fr...> Sent by: jyt...@li... 02/15/2008 02:03 PM To cl...@br... cc jyt...@li... Subject Re: [Jython-users] Jython (Python) syntax question Maybe setattr(self,'no-loop',TRUE) cl...@br... wrote: > Dear colleagues, > > porting a Drools semantic (rules definition language) into a Jython code. > The code throws a syntax error at the following line: > > TRUE = 1 > FALSE = 0 > .. > self.salience = 30 > self.no-loop = TRUE > > Error: Syntax error can´t assign to operator. > > Looks like the Jython acts like a Python interpreter, rejecting the right > side of the assignment statement, thinking "self.no-loop" is an > expression. > Indeed inside Java DRL, the "no-rule" is an attribute, like this <rule > name="rule1" salience="30" no-rule="true"> > > Any idea how to fix the syntax error? > > Regards, > Claude > > Claude Falbriard > Developer > AMS Hortolândia / SP - Brazil > phone: +55 13 8126 7787 > cell: +55 13 8117 3316 > e-mail: cl...@br... > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |