CodeGeneration - Maple Programming Help

Home : Support : Online Help : Programming : Code Generation Package : CodeGeneration/Save

CodeGeneration

 Save
 save defined languages to archive

 Calling Sequence Save( archive, language = l )

Parameters

 archive - (optional) string; Maple library l - (optional) string, list, or set; translators to save

Description

 • The Save command saves one or more language translators to the specified Maple archive.  This command is used for saving any user-defined languages added with tools from the CodeGeneration[LanguageDefinition] subpackage.
 • The language translators to be saved are specified with the language = l option.  The parameter l may be a string corresponding to a defined language name, or a list or set of strings which correspond to several defined language names.
 • If archive is specified, then the languages are saved in the corresponding library. If the library file does not exist, it is automatically created.
 If archive is specified as a directory, Maple assumes the default library name, maple.mla. Otherwise, you must specify archive as a path and library name.
 • If archive is not specified and savelibname is assigned, but does not specify a library, an error is generated.
 If archive is not specified and savelibname is unassigned, the first library appearing in libname is used.
 Note: Save cannot write to a library that is read-only. In this case, an error is generated.

Examples

Save a newly-defined language to an archive for later re-use.

 > $\mathrm{with}\left(\mathrm{CodeGeneration}\right):$
 > $\mathrm{savelibname}≔"/home/maple/lib"$
 > $\mathrm{LanguageDefinition}[\mathrm{Define}]\left("SaveExample",\mathrm{extend}="C",\mathrm{AddOperator}\left(\mathrm{Names}:-\mathrm{Assignment}=":="\right)\right);$$\mathrm{Save}\left(\mathrm{language}="SaveExample"\right)$