At the NESL prompt you can type a NESL top-level expression, as defined by the language, or a top-level command, which is used to control or examine various aspects of the environment. The top-level commands are summarized in Figure 1 and most are described in Section 3.
Figure 1: Top-level commands (screendump obtained by typing ?).
A top-level expression is one of
where exp is any expression and pattern can either be a single variable name or a parenthesized pattern of variable names (the square brackets indicate that the typedef in a function definition is optional). A full syntax for each of these is given in Appendix A of the NESL language definition [1]. Some examples of top-level expressions include:
Expressions that are not assigned to a user defined variable are assigned to the variable it.function double(a) = 2*a; function add3(a,b,c) = a + b + c; datatype complex(float,float); foo = double(3) + add3(1,2,3); foo;
If you hit Return before an expression is completed, either for readability or by mistake, a ``>'' is printed at the beginning of each new line until the expression is completed. For example:
If you get lost, instead of hitting Ctrl-C try typing a few semicolons to end the expression.<Nesl> 2 > + > 3; Compiling..Writing..Loading..Running.. Exiting..Reading.. it = 5 : int
For an example NESL session showing many features of the language, see Appendix A.