Printer - Maple Help

Home : Support : Online Help : Programming : Code Generation Package : Language Definition : Printer : CodeGeneration/LanguageDefinition/Printer/GetFunctionSignature

Printer

 GetFunctionSignature
 get list of type signatures for function

 Calling Sequence Printer:-GetFunctionSignature(fname)

Parameters

 Printer - Printer module fname - string; function name

Description

 • The GetFunctionSignature command returns a list of acceptable type signatures and precisions for a function fname.
 • An element of the list returned is itself a list, whose first operand is an accepted type signature for fname, and whose second is a set specifying the precision of this signature.
 • If fname has not been defined with the AddFunction command, then GetFunctionSignature returns the empty list.

Examples

 > $\mathrm{with}\left(\mathrm{CodeGeneration}\right):$
 > $\mathrm{Printer}≔\mathrm{LanguageDefinition}[\mathrm{DefaultPrinter}]\left(\right):$
 > $\mathrm{Printer}:-\mathrm{AddFunction}\left("sin",\left[\mathrm{numeric}\right]::\mathrm{numeric},"sin"\right)$
 $\left[{"sin"}{,}\left\{{}\right\}\right]$ (1)
 > $\mathrm{Printer}:-\mathrm{AddFunction}\left("cos",\left[\mathrm{numeric}\right]::\mathrm{numeric},"cos"\right)$
 $\left[{"cos"}{,}\left\{{}\right\}\right]$ (2)
 > $\mathrm{Printer}:-\mathrm{AddFunction}\left("tan",\left[\mathrm{numeric}\right]::\mathrm{numeric},"tan"\right)$
 $\left[{"tan"}{,}\left\{{}\right\}\right]$ (3)
 > $\mathrm{Printer}:-\mathrm{AddFunction}\left("tan",\left[\mathrm{numeric},\mathrm{numeric}\right]::\mathrm{numeric},"tan"\right)$
 $\left[{"tan"}{,}\left\{{}\right\}\right]$ (4)
 > $\mathrm{Printer}:-\mathrm{GetFunctionSignature}\left("cos"\right)$
 $\left[\left[\left[{\mathrm{numeric}}\right]{::}{\mathrm{numeric}}{,}\left\{{\mathrm{numeric}}{=}\left\{{\mathrm{double}}{,}{\mathrm{generic}}{,}{\mathrm{single}}\right\}\right\}{,}\left\{{}\right\}\right]\right]$ (5)
 > $\mathrm{Printer}:-\mathrm{GetFunctionSignature}\left("tan"\right)$
 $\left[\left[\left[{\mathrm{numeric}}\right]{::}{\mathrm{numeric}}{,}\left\{{\mathrm{numeric}}{=}\left\{{\mathrm{double}}{,}{\mathrm{generic}}{,}{\mathrm{single}}\right\}\right\}{,}\left\{{}\right\}\right]{,}\left[\left[{\mathrm{numeric}}{,}{\mathrm{numeric}}\right]{::}{\mathrm{numeric}}{,}\left\{{\mathrm{numeric}}{=}\left\{{\mathrm{double}}{,}{\mathrm{generic}}{,}{\mathrm{single}}\right\}\right\}{,}\left\{{}\right\}\right]\right]$ (6)