combinat::warnDeprecated --
issue of warnings when deprecated features are used
Introduction
combinat::warnDeprecated controls whether deprecated functions such as
combinat::powerset issue warnings.
Call(s)
combinat::warnDeprecated()
combinat::warnDeprecated(mode)
Parametersmode | - | TRUE or FALSE |
Returnsthe (former) setting of the switch
Detailscombinat library in MuPAD 2.5 is a major rewrite
compared to MuPAD 2.0. Several functions or features known from
earlier versions are considered deprecated and only forward calls
to the corresponding new functions. After combinat::warnDeprecated(TRUE) is
invoked, each such call will issue a warning.
combinat::warnDeprecated(TRUE) turns on those warnings, combinat::warnDeprecated(FALSE)
switches them off, and combinat::warnDeprecated() returns the current setting.
Pref::warnChanges().
Related Functions
Example 1The function combinat::powerset is deprecated. By
default, it simply forwards to
combinat::subsets::list:
>> combinat::warnDeprecated(FALSE):
combinat::powerset({a,b,c})
{{}, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}
If you plan to adjust your code to future MuPAD versions, you should switch on the warnings about deprecated functions and change all such calls to their new versions:
>> combinat::warnDeprecated(TRUE):
combinat::powerset({a,b,c})
Warning: combinat::powerset is obsolete.
Please use 'combinat::subsets' and 'combinat::subwords' instea\
d. [combinat::powerset]
{{}, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}
Example 2Here, we show how to temporarily switch on or off the warnings, and to restore the previous state afterward:
>> oldval := combinat::warnDeprecated(FALSE):
combinat::partitions(4);
combinat::warnDeprecated(TRUE):
combinat::partitions(4);
combinat::warnDeprecated(oldval):
5
Warning: combinat::partitions(n) is obsolete.
Please use 'combinat::partitions::count(n)' instead. [combinat\
::partitions::new]
5
MuPAD Combinat, an open source algebraic combinatorics package