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

WIP

schedule

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

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

WIP


Last update: 2023-10-24
Created: 2023-10-16