[Next] [Previous] [Up] [Top] [Contents] [Index]

4 Program Control

Order of Execution

Order of execution is defined for the constituents within a body. With some exceptions noted below, this execution order is left-to-right.

Definitions form the overall structure of a program and are not said to execute. In particular, module bindings are not created in any order, but all exist when program execution commences. To the extent that these bindings must be initialized by the values of some expressions which cannot be analyzed at compile time, references to the bindings are constrained by the execution order of the expressions within the surrounding body.

Dylan implementations are encouraged to allow forward references to module bindings whenever possible.

The order of execution of the components of a call to a user-defined macro is determined by the macro.

Execution Order Within Expressions

In general, execution within an expression proceeds left-to-right. The chief exception to this rule is the assignment operator, which is executed right-to-left.

one(two, three, four)
 one[two, three]  
one + two - three
function-setter(one, two, three)
function(two, three) := one
slot-setter(one, two)
two.slot := one
element-setter(one, two, three)
two[three] := one
aref-setter(one, two, three, four)
two[three, four] := one

Dylan Reference Manual - 17 OCT 1995
[Next] [Previous] [Up] [Top] [Contents] [Index]

Generated with Harlequin WebMaker