The LHS of a rule R_blup
contains
(test (>= ?s2 2))
that is, it checks if ?s2
is greater or equal to 2. ?s2
corresponds to an instance slot named s2
.
Unfortunately, I get the error
Function >= expected argument #1 to be of type integer or float
The problem is that my code executes the (test ...
before I can set argument #1, i.e. before I can set s2
to an integer or float value. s2
is supposed to be set to an integer inside a python-call that is triggered by another rule R_blah
.
The error is triggered in the middle of another python-call belonging to another rule R_xyz
. This python-call modifies an instance via clips_instance.Slots["slot_name"] = some_value
.
How is this normally handled? I see three solutions I don't like too much:
- Setting a default (integer) value for
s2
. - Modifying the
(test ...
to check againstnil
first. - Adding another check/rule to wait until
s2
is notnil
any more
Is it maybe possible to try/except/pass the error?