Predicating Operations
Note: In the current implementation, the ambiguity of the meaning of the second argument in the predicate operations can present collision problems. Syntax changes are being considered.
@when
Use the when operation to predicate target execution without having to write a separate composition.
It considers the value at a given location from within the global store and then:
a) executes a given target if the source value evaluates as truthy b) compares the source value to another value in the global store as resolved from another given keypath. c) compares the source value to a literal string value if that value does not resolve as a keypath to a value in the global store.
Syntax
@when/{source keypath}[::{source keypath OR string literal}]::{target name}
Arguments
source keypath
- keypath from which to resolve a value from the global store.source keypath OR string literal
(optional) - keypath from which to resolve a value from the global store OR a string literal. The value, whether resolved from the store or given, will be used to make a loose equality comparison with the value resolved from the first argument.target name
- name of target to execute based on resolution of predicate.
Examples
@when-not
The @when
operation with the result of the predicate negated.
Examples
@exit-when
Use the exit-when operation to predicate process exit.
It considers the value at a given location from within the global store and then:
a) exit the process if the source value evaluates as truthy b) compares the source value to another value in the global store as resolved from another given keypath. c) compares the source value to a literal string value if that value does not resolve as a keypath to a value in the global store.
Syntax
@exit-when/{source keypath}[::{source keypath OR string literal}]
Arguments
source keypath
- keypath from which to resolve a value from the global store.source keypath OR string literal
(optional) - keypath from which to resolve a value from the global store OR a string literal. The value, whether resolved from the store or given, will be used to make a loose equality comparison with the value resolved from the first argument.
Example
@proceed-when
The @exit-when
operation with the result of the predicate negated.
Examples
Last updated