type/nothing - Maple Programming Help

Home : Support : Online Help : Programming : Data Types : Type Checking : Types : type/nothing

type/nothing

check for any type

 Calling Sequence type(expr, nothing)

Parameters

 expr - any expression

Description

 • No valid maple expression is of this type.  That is, this type always returns false.
 • Expression sequences cannot be allowed, because each element would be interpreted as a separate argument to type.
 • Note that one use of this type is for a local variable declaration in a procedure, and indicates that the local is to be used as-is (e.g. in an internally constructed polynomial, or as a temporary placeholder), and will not be assigned. This is helpful to avoid mint warnings for variables that are used but not assigned.

Examples

 > $\mathrm{type}\left({5}^{\frac{1}{2}},\mathrm{nothing}\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{type}\left(\frac{\mathrm{sin}\left(3x\right)}{\mathrm{\pi }},\mathrm{nothing}\right)$
 ${\mathrm{false}}$ (2)

The following procedure computes a binomial coefficient and requires x be declared of type nothing to avoid a mint warning for use of an unassigned variable:

 > f := proc(n::posint, i::nonnegint) local pol, x::nothing; pol := expand((x+1)^n); return coeff(pol,x,i); end proc: