Creating a Visual Lambda Module

In this chapter we demonstrate how to create a Visual Lambda with a certain signature. For more information about types and signatures, see " Type, Module and Signature".

 

Visual Lambda Module Dialog

In the "Repository Explorer" tool window, select the "FIXVisualLambda" node, right click mouse, and choose "New Module" from pop up window.

 

A module dialog will pop up. Choose a new name for the new module and click "OK" button. A new Visual Lambda module will be created and opened in the Visual Lambda editor. Note the name of the module must not conflict with other module names in the repository and must follow the Naming Convention.

 

 

Setting Return Type

A Visual Lambda module is actually a function in programming language. Like functions in other popular languages, a module can return a value.

By default, when a module is created, it is configured not to return anything. In another word, it is an "action module". In Visual Lambda editor, a special "#void" return type is displayed.

User can change the return type by right clicking the "Module" node (which is the root of the tree) and select "Set Return Type" in the pop up menu. The editor will prompt user with a list of all types supported by the system, including basic types and collection of basic types.

 

 

Setting Parameters

A Visual Lambda module is actually a function in programming language. Like other popular programming languages, a module can have a list of parameters. Types and order of parameters, along with return type, are called signature.

A parameter has a name and a type. To add a parameter, right click the "Parameters" node in the tree view, and select a type in pop up menu. A parameter name dialog will pop up asking for the parameter name. Give the parameter a name and click "OK" button, a parameter will be created and displayed in the tree view under "Parameters" node.

User can also modify the order of parameters, change parameter names, add new parameters or remove existing parameters.

 

 

Setting Variables

Variables can be used to store intermediate computation results. Variables are only visible inside the scope of module.

Like parameters, a variable also has a name and a type.

Adding variables is similar to adding a parameters. Just right click on "Variables" node and follow the procedures.

 

 

Setting Collections

Read only fixed size collections can be added to a module.

Collections defined inside a module are only visible to the module.

Collections are useful to perform operations such as testing whether or not an item is contained in a pre-defined set.

 

 

Setting Regular Expressions

Constant strings of regular expression can be added to a module.

The regular expression can be used to test string patterns or perform string transformations.

To add a regular expression, right click "Regex" node in the tree view, then choose "Add New Regex" from the pop up menu.

A regular expression customization dialog is shown below.