OM# Documentation

Evaluation

Evaluation is the essential mechanism of program execution in OM. Evaluating a box means requesting it to compute a value by applying a function to it’s inputs. When the inputs are connected, the evaluation propagates to upstream connected boxes, until all requested values allow the computation of the box.

Use the V shortcut to evaluate the selected box(es) in the patch.

During evaluation, the box gets highlighted with a light-green frame.

When the evaluation terminates, the result is printed in the Listener. Use Ctrl/⌘ + shift + L , or open the listener pane in the patch editor with the button if it is not visible.

Note: Boxes with multiple outputs are called “multivalued”. Their result is displayed in the Listener as a list of values separated by comas.


list outputs a single “value”: the list (0 8). list-elements outputs two separate values (0 and 8).

Alternatively:

Note: shift + I reinitializes the box value – this is useful essentially for object boxes.


Lock state / evaluation mode

Boxes can be set in special states determining their behaviour at evaluation. The state can be set using keyboard shortcuts or from the box inspector.

For now, we will say that the box can be locked / unlocked with B:
When a box is locked, no evaluation occurs and the box just returns its current (last-computed) value.

See more in Evaluation Modes.


Abort

You might want to abort an ongoing evaluation, either because it gets too long, or because something wrong happened (e.g. an uncaught error – see below).

Use the “Edit/Abort Evaluation” menu command [ Ctrl/⌘ + shift + A ] menu to abort an evaluation.


Errors

There’s a lot of possible reasons why a evaluation box evaluation can lead to an error !

The option “Handle error messages” in OM’s General Preferences allows you to limit the consequences of such error being thrown by an executing OM program (when possible!), by displaying up a simple error message on a pop-up window. If this occurs, the box responsible for the error will be highlighted in red.

Dismissing from the error will exit from the error and abort the current execution.

If for some reason an error occurs that is not aught by OM’s error reporting system, you can still abort the process with Ctrl/⌘ + shift + A.