|
![]() |
||||||||||||||
Program Structure TutorialLocal DefinitionsLocal definitions include both local expression definitions and local function definitions. All local definitions are introduced including where expressions. A where expression consists of a main expression body and a block of local definitions. It has the following syntax: <main-expression> where { <definition> <definition> ... } Local expression definition has the form: <name> = <expression> Local function definition has the form: <name>(<arguments>) = <expression> The expression of a local definition can contain references to its own arguments and names defined at the same level and less-locally in the code. The order of ocal definitions is not important. The where expression may reference its local definitions names. Source code:add( 'a', something ) where{ something = add( 'x', 'y' ); add(x,y) = x + y; } Result:"axy"
|
|
||||||||||||||
© 2006 Saša Malkov | |||||||||||||||