How can salience be declared using the BuildRule() function?

Salience declaration is part of the LHS of the rule, so it is legal to declare salience in the LHS. The implementation of BuildRule() relies on the more general Build() function: the construct is converted to a string and then sent to the CLIPS engine via the same low-level call that Build() invokes, while immediately looking up for the newly created rule and returning it as an object. Unfortunately there is currently no way to set the salience of a rule after building it (eg. as a property of the returned Rule object). An example follows:

r = clips.BuildRule("duck-rule",
    """(declare (salience 99))
       (duck)
    """, "(assert (quack))")

Of course PyCLIPS does not rely on multi-line strings and spacing, as its main delimiter is the bracket. The above example uses multiple lines only for sake of readability.