The compound event operators used previously were given as infix, binary operators. (The term infix describes operators that are placed syntactically between their operands.) Event expressions also allow variable arity event operators that provide more convenient methods of expressing patterns over large numbers of events. (The term arity refers to the number of parameters a function takes. Variable arity functions can take a variable number of parameters.) Using compound operators in this way follows this pattern:
Code Block |
---|
theme | Confluence |
---|
language | javascript |
---|
theme | Confluence |
---|
|
select when <eventop>(E1,[el]En) |
In the previous example, <eventop>
is one of or
, and, before
, after
, or then
. Variable arity functions are merely a convenience because their semantics can be expressed using the binary operators. For example, the following two select
statements are equivalent:
Code Block |
---|
theme | Confluence |
---|
language | javascript | theme | Confluence |
---|
|
select when and(A, B, C, D, E)
select when A and (B and (D and (C and E))) |
...