Skip to content

Traversal

Traversal Context

Context Semantics
parallel All array elements are scheduled for traversal in parallel.
schedule All array elements are scheduled for traversal independently.
select One array element is randomly selected and traversed.
sequence All array elements are scheduled for traversal in sequence from 0 to N-1.

parallel

Not support yet

WIP

schedule

v1.0.0

Both actions (i.e., sub with "Hello" and "World") in schedule block will be traversed in random order.

action top {
    activity {
        schedule {
            do sub with { str == "Hello"; };
            do sub with { str == "World"; };
        }
    }
}

action sub {
    rand string str;
    exec body ASM = """{{str}}""";
}

There have two possible results:

Hello
World
World
Hello

select

v1.0.0

Only one action in select block will be chosen and traversed.

action top {
    activity {
        select {
            do sub with { str == "Hello"; };
            do sub with { str == "World"; };
        }
    }
}

action sub {
    rand string str;
    exec body ASM = """{{str}}""";
}

There have two possible results:

Hello
World

sequence

v1.0.0

WIP