# Section 6.3.1:
Routine Signatures

A routine is a language construct that encapsulates programmer-defined actions and control in a similar manner to the role played by routines, procedures and functions in many other programming languages. A routine signature therefore defines the forms and types of arguments and, if appropriate, a returned value type definition.

The only difference between routine and iter parameters is that a routine parameter may not be specified as 'once'.

#### Concrete Syntax

abstract routine signature = | identifier, [routine parameter pack], [return signature] ;

routine parameter pack = | Left_Parenthesis_SY,
| routine argument list, Right_Parenthesis_SY ;

routine argument list = routine argument, {Comma_Sy, routine argument} ;

routine argument = routine mode, identifier list, return signature ;

routine mode = [(Out_SY | Inout_SY)] ;

#### Abstract Syntax

The Feature abstract syntax which is common to all class components is given here with an invariant specifically for the case of a routine. Since this is a signature there is no implementation component and no value.

Feature ::
name : token
args : [ set of Feature ]
kind : [ Type_Specifier ]
value : [ Expression ]
impl : [ seq of Statement ]
vis : [ Visibility ]
ext_vis : Visibility
uses : [ Method_Kind ] ;
inv mk_Feature(-,-,-,val,impl,-,-,use) ==
use = One_Shot
and impl = nil
and val = nil

#### Static Semantics

TO BE DONE

#### Dynamic Semantics

Having no implementation and no value - being only a signature (found in abstract classes or as a stub or type definition) there can be no run-time meaning.

| Specification Index |  | Language Index |  | Examples |  | Section 6 Index

Comments or enquiries should be made to Keith Hopper . Page last modified: Friday, 26 May 2000. |