Tag Info

New answers tagged


Since Mathematica version 10 there's FilterOptions function from GeneralUtilities` context, that can be useful here. Using it you don't have to explicitly pass filtering pattern e.g. Options[f1] when defining f2, it will be automatically inferred from context: Needs["GeneralUtilities`"] ClearAll[f1, f2, Flag1, Flag2] Options[f1] = {Flag1 -> True}; ...


A symbol's context is determined by the Context[] where it first appears. So, the ::usage statements for f1 and f2 are sufficient to put them into the OptionInheritanceTest` context. This means you can move the Options declarations into `Private` without bringing f2 and f3 into that context. This creates a problem, as the first appearance of Flag1 and Flag2 ...

Top 50 recent answers are included