Skip to content

Signatures and name doubling

Leon Starr edited this page Nov 6, 2023 · 9 revisions

Signatures

In all activity types, parameter names are specified using formal : actual pairing and never with implicit ordering. Consider an event specification defined as follows:

Set new dest( Destination : Name, Direction : Vertical Direction ) // Not Scrall!

Two parameters, Destination and Direction, with data types Name and Vdir are required in the Set new dest event specification. To generate a corresponding event, supply values of the appropriate types paired up with the parameter names in any order.

Set new dest( Direction : ^dir; Destination : ^dest floor ) -> ME

No need for name doubling

Note how the parameter names and supplied variable names closely match? As a convenience, and to avoid name doubling clutter, you can drop the formal parameter if the name of the actual parameter matches the formal parameter name. Let’s change the event specification so that the "Direction" parameter is now named "Dir".

Set new dest( Dest floor : Name; Dir : Vertical Direction ) // Not Scrall!

Now the formal parameter names match the actual parameter names the action can be shortened like this:

Set new dest( ^dir, ^Dest floor ) -> ME  // less clutter

The match is not case sensitive, since there is a convention of using initial caps for parameter names and all lower case for flow names. So the flow name "dir" will match the parameter name "Dir".

The action language is also easier to read and less trouble to write. If the actual parameter and formal names don’t match, a static error results.

Introduction

Model semantics

Flows (as Variables)

Constants and literals

Structure of an activity

Accessing the class model

Data flow


Grammar and parsing notes

Components

Clone this wiki locally