I have a replacement rules list, but its quite long and therefore I would like to make a standalone package of it. I tried but haven't succeeded. A simple example of my approach is
BeginPackage["Rules`"]
Rules::usage="Rules[x] applies rules on expression x."
Begin["Private`"]
RulesDef = {a->2,b->3};
Rules[expr_]:=expr//.RulesDef
End[]
EndPackage[]
However, when I call Rules[a + b]
, it gives me a + b
instead of 5
.
How should I put such a rules into a package, if it is possible?