Skip to content

Remove VERBOSE global variable in RuleBasedMethod #19

@Bumblebee00

Description

@Bumblebee00

Right now integrating with RuleBasedMethod(verbose=true) sets a global variable to true. this is not thread-safe. But carrying the setting as a parameter through the call chain and using it locally is not so simple.

the reason i made it global is that some rules if applied call the utlity function int_and_subst, that is like a change of variable: first integrate an expression and then substitute in the result another expression. To make the printing of rules behave correctly, the int_and_subst function prints the rule that called it, and then silences it using the SILENCE global variable so that it is not printed twice when the result is returned.

All this to say that i need to know in the int_and_subst function if verbose is true, and i cannot do this without a global variable. Whitout a global variable I would need somehow to pass the verbose parameter to the rule that calls int_and_subst, but rules have only one parameter and no keyword arguments

I tought about this for a bit but I cant come up with a way to communicate to int_and_subst function the verbose flag without a global variable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions