RandomTools - Maple Programming Help

Home : Support : Online Help : Programming : Random Objects : RandomTools package : Commands : RandomTools/HasFlavor

RandomTools

 HasFlavor
 check if a flavor template is known

 Calling Sequence HasFlavor(flvr)

Parameters

 'flvr - symbol; represents a flavor in the form of a procedure or module

Description

 • The HasFlavor(flvr) function returns true if the flavor specified by flvr is known to function Generate.  Otherwise, false is returned.
 • This function is part of the RandomTools package, and so it can be used in the form HasFlavor(..) only after executing the command with(RandomTools). However, it can always be accessed through the long form of the command by using the form RandomTools[HasFlavor](..).

Examples

 > $\mathrm{with}\left(\mathrm{RandomTools}\right):$
 > $\mathrm{HasFlavor}\left(A\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{AddFlavor}\left(A=\mathrm{rand}\left(1..20\right)\right):$
 > $\mathrm{HasFlavor}\left(A\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{Generate}\left(A\right)$
 ${15}$ (3)
 > $\mathrm{member}\left(A,\left[\mathrm{GetFlavors}\left(\right)\right]\right)$
 ${\mathrm{true}}$ (4)