[Previous] [Next] [Contents]

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)

Parameters

mode- TRUE or FALSE

Returns

the (former) setting of the switch

Details

Related Functions

Pref::warnChanges

Example 1

The 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 2

Here, 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
        

[Previous] [Next] [Contents]


MuPAD Combinat, an open source algebraic combinatorics package