Commit 0cdd1a91 authored by Matthias Simon's avatar Matthias Simon
Browse files

Continue parameterization

parent d828b04e
Loading
Loading
Loading
Loading
+18 −20
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ In TTCN-3, [functions], [altsteps] and [testcases] are used to specify and
structure test behaviour, define default behaviour and to structure computation
in a module.

The extension for [object oriented features] also permits declaring [methods].
Further, the extension for [object oriented features] permits declaring [methods].

Platform specific behaviour may be provided by the means of [external
functions].
@@ -16,8 +16,8 @@ functions].

### General

Parameterization may be used to specify dynamic behaviour -- or [values
in the case of dynamic templates](15.2).
Parameterization may be used to specify dynamic behaviour -- or [dynamic
templates](15.2).

TTCN-3 distinguishes between different kinds of parameterization:

@@ -25,13 +25,13 @@ TTCN-3 distinguishes between different kinds of parameterization:
- _type parameterization_ as specified in [advanced parameterization
extension].

> NOTE: technically there is also a kind of indirect parameterization through
> the use of references. But it is strongly recommended to favor the more
> explicit _value parameterization_ over _indirect parameterization through
> references_ when possible; because the later can introduce subtle
> inconsistencies between individual tools and use-cases.
>
> The term _parameterization_ will be used interchangeably with _value
> NOTE: technically there is also indirect parameterization through the use of
> references. But it is strongly recommended to favor the more explicit _value
> parameterization_ over _indirect parameterization through references_ when
> possible; because the later can introduce subtle inconsistencies between
> individual tools and use-cases.

> NOTE: The term _parameterization_ will be used interchangeably with _value
> parameterization_ in this document, unless stated differently.

> NOTE: Parameters are very similar to variables in the sense they provide a
@@ -112,18 +112,16 @@ same _formal parameter list_.
A _formal parameter_ may have an _initial value assignment_. Such a parameter
is called _default parameter_ and is described in [default parameters].

A _formal parameter_ is either an _in-parameter_ (indicated by the `in`
keyword), _inout-parameter_ (indicated by the `inout` keyword) or
_out-parameter_ (indicated by the `out` keyword).
A _formal parameter_ without any of these keywords is considered an _in-parameter_.

A _in-parameter_ is _passed by value_. Each invocation of the parameterized
TTCN-3 language object has its own copy.
A _formal parameter_ is either an _in-parameter_, indicated by the `in`
keyword, _inout-parameter_, indicated by the `inout` keyword, or
_out-parameter_, indicated by the `out` keyword.

A _out-parameter_ is passed by value_.
A _formal parameter_ without any of these keywords is considered an
_in-parameter_.

> TODO: Hat ein out-parameter sein egienen memory (wie in-parameter). Wann passiert expansion,
> 
An _in-parameter_ is _passed by value_. 
A _out-parameter_ is also _passed by value_.
Each invocation of the parameterized TTCN-3 language object has its own copy.

A _inout-parameter_ is _passed by reference_.