### 61.5 Gentran Evaluation Forms

The following special functions can be included in Maxima statements which are to be translated by the gentran command to indicate that they are to be partially or fully evaluated by Maxima before being translated into numerical code. Note that these functions have the described effect only when supplied in arguments to the gentran command.

Function: eval (exp)

  Where exp is any Maxima expression or statement which, after evaluation by Maxima, results in an expression that can be translated by gentran into the target language. When eval is called from an argument that is to be translated, it tells gentran to give the expression to Maxima for evaluation first, and then to translate the result of that evaluation.

Function: rsetq (var, exp)

  Where var is any Maxima variable, matrix or array element, and exp is any Maxima expression which, after evaluation by Maxima results in an expression that can be translated by Gentran into the target language. This is equivalent to VAR : EVAL(EXP) ;

Function: lsetq (var, exp)

  Where var is any Maxima user level matrix or array element with indices which, after evaluation by Maxima, will result in expressions that can be translated by Gentran, and exp is any Maxima user level expression that can be translated into the target language. This is equivalent to `var[eval(s1), eval(s2), ...]: exp` where s1, s2, ... are indices.

Function: lrsetq (var, exp)

  Where var is any Maxima matrix or array element with indices which, after evaluation by Maxima, will result in expressions that can be translated by Gentran; and exp is any user level expression which, after evaluation, will result in an expression that can be translated by Gentran into the target language. This is equivalent to `var[eval(s1), eval(s2), ...]: eval(exp);`.

Function: type (type,v1…vn)

  Places information in the gentran symbol table to assign type to variables v1…vn. This may result in type declarations printed by gentran depending on the setting of gendecs. type must be called from within gentran and does not evaluate its arguments unless eval() is used.

Function: literal (arg1, arg2, ... , argn)

  where arg1, arg2, ... , argn is an argument list containing one or more arg’s, each of which either is, or evaluates to, an atom. The atoms tab and cr have special meanings. arg’s are not evaluated unless given as arguments to eval. This function call is replaced by the character sequence resulting from concatenation of the given atoms. Double quotes are stripped from all string type arg’s, and each occurrence of the reserved atom tab or cr is replaced by a tab to the current level of indentation, or an end-of-line character.