NeturalMath Language Definition and Syntax

The import keyword

The import keyword opens a NeturalMath file and evaluates its contents. This has the effect of executing the code in another file inline within the current executing code. If the file being imported has already been imported into the current domain, or one of its ancestor domains, and excpetion will be thrown unless the /a modifier is used.

This section is not complete

Syntax

The general syntax for the import keyword is as follows:

import [/a] [/s] filepath

Options

There are several options which may be used with the import keyword to modify its behavior. These options are specified in the form of command-line arguments.

/a

The /a option allows a file to be safely called from a domain, even if it has already been loaded in that, or a parent domain. If the import target has already been loaded, the import statement will be ignored by the system.
import myfile.math

// next line throws an exception
import myfile.math

// next line is correct
import /a myfile.math

/s

The /s option causes print and printf statements to be ignored when loading the file. This allows a file to be loaded without any messages being displayed to the console.
// Contents of myfile.math

x = 10
print x

:> // import file without the /s option
:> import myfile.math

10
:>print x + 2

12

:> // import file with the /s option
:> import /s myfile.math
:>print x + 2

12

Usages

This section is not complete

See also

This section is not complete

Last edited Oct 16, 2010 at 6:06 PM by zanethorn, version 7

Comments

No comments yet.