Go to the first, previous, next, last section, table of contents.

Class Function

Class Function serves to keep track of the source code for a given executable, and other information needed to recompile it, such as the compiler used to translate from source to executable form.

This information could be kept in the executable itself, of course, but keeping it in a separate object has a number of advantages:

Class Function adds the following properties to those of Class Plain:

$S.arity:	Number of arguments accepted and returned.
$S.executable:   Most recently compiled executable. There may be others.
$S.compiler:     Program translating source to executable.
$S.fileName:    Debug information: Name of source file.
$S.fnLine:      Debug information: Starting line number in source file.
$S.lineNumbers: Debug information: vector of line numbers, one per bytecode.
$S.source:       String source code.
$S.localVariableNames: Vector of string names for local variables.
$S.specializedParameters:  NIL or count of required args for generic.
$S.defaultMethods:  NIL or mosKey of methods with t as 1st arg specializer.

Note: For convenience, the $S properties are also available in the public (default) propdir.

The fnLine value, and the integers in the lineNumbers vector, are all zero-based: The first line in a file is line zero, the first line in a function is line zero. However, users expect line numbers to begin at one, and text editors conventionally number them this way, so you should add one to either when displaying it.

As of version -1.0.0, compiler and debug information is not used. See section explodeArity.

Go to the first, previous, next, last section, table of contents.