next up previous contents index
Next: Monitoring execution Up: Top-level Commands Previous: Loading NESL files

Customizing output

set verbose {on,off};  
This turns the verbose mode on or off. When verbose mode is off, the NESL system no longer prints

when evaluating an expression at the top level. Note that this command is local to a file, so that putting it in your .nesl file   only turns verbose mode off while that file is being loaded. Verbose mode is often useful when debugging a new configuration (see Section 5.5).

set print_length n;  
This sets the maximum print length for sequences returned at the top level. Only n elements of a sequence are printed on the screen, followed by ``...''. The default value for print_length is 100. The print length applies to each level of a nested sequence . For example:

<Nesl> set print_length 3;
<Nesl> x = [[1:10],[1:10],[1:10],[1:10]];
x = [[1, 2, 3,...], [1, 2, 3,...], [1, 2, 3,...],...] : [[int]]

pattern |= exp;  
By typing a |= exp; at the top level, the expression exp is assigned to the file variable a. The pattern can be any variable pattern. This construct is useful for evaluating expressions with a large return value, because the user does not have to wait for the result to be read back into NESL--only the type is returned. You can use file variables in expressions just like any other variables. Here is an example:

<Nesl> a |= index(10000);
a : [int]
<Nesl> sum(a);
it = 49995000 : int
<Nesl> function foo(n) = take(a,n);
foo = fn : int -> [int]
<Nesl> foo(10);
it = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] : [int]
File variables are stored in the temp_dir  specified by the configuration (/tmp/ by default). This means that if you switch your configuration to a new configuration with a different temp_dir, the VCODE interpreter won't be able to find the variable and will give a runtime error message. Files created in this process are not removed by NESL.

Guy Blelloch
Tue Nov 28 18:37:09 EST 1995