OM# Documentation

Value Box

The “value box” is the simplest element in OM# visual programs. It just contains / display a value, which can be of one of the following Common Lisp types:

Type N or double click anywhere on the patch editor background to display a temporary text-input field ; then type/paste the value and press ENTER.


About Types

Note that the type of the value can be crucial in the correct evaluation of your programs.
For instance, “4” and 4 are very different kind of data ("4" is a string, 4 is a number) and (om+ "4" 1) is not a correct expression to evaluate :

This section contains links top the online edition of Common Lisp the Language, 2nd Edition, by Guy L. Steele.

Types of Numbers

Characters and Strings

Symbols

A symbol is a specific data type used to bind variable and function with names. It is defined by a name, a value and interned in a package. The external representation of a symbol is a string without double-quotes (e.g. abc).

In Common Lisp the evaluation of a symbol returns its value (e.g. if the value of the symbol x is 5, x evaluates to 5). In order to prevent this the language includes a quote mechanism : 'x evaluates to the symbol x, not to its value.

=> Use this quote mechanism to enter a symbol as value in a value box.

Common Lisp symbols are interned in packages which must sometimes be explicitly stated along with the same. For convenience symbols used for their name (e.g. different options for the input of a function) are sometimes used with the special “keyword” package. In this case, the symbol is prefixed with a colon (e.g. :abc) and doesn’t require a quote.


Lists

A list is a sequence of any number of elements of any types, included between a pair of parentheses.


Edit the Value

Double-click the box to edit its contents. Note that the value can change type depending on the contents (for instance the number 4 can be turned into into the string “4”).

Drag-edit numbers

When the value is a number, it is possible to increase/decrease this value using Ctrl/⌘ + click/drag on the box (or Ctrl/⌘ + shift + click/drag for a greater edit-step).

When the patch is locked this procedure works without the Ctrl/⌘ key.


Connections

The value box has one output which can be connected anywhere to supply value in a visual program.

It also has a free number of additional/optional inputs, which allows the value to come from other part of this same visual program. The value-box then becomes a convenient way to store and display intermediate results in a visual program:

Note: If the value-box has several inputs, the internal value becomes a list collecting these values:


Popping-up value boxes

Value boxes are created automatically: