Table of Contents
Op! values are infix functions of two arguments that are constructed from existing native!, action!, function!, or routine! values.
Op! values take evaluation precedence over other function types and over set-word! values. They cannot contain optional arguments.
Op! is a member of the following typesets: any-function!, default!
Op values can be created at runtime by using a make constructor.
<op> ::= make op! <prefix-function>Examples
Logical or and and operators.
>> ||: make op! func [a b][any [a b]] ; return the first value that is true
== make op! [[a b]]
>> 1 || 2
== 1
>> false || 2
== 2
>> &&: make op! func [a b][all [a b]] ; if all values are true, return the last value; else return none
== make op! [[a b]]
>> 1 && 2
== 2
>> false && 2
== noneOp values can be compared for sameness and equality with same?, ==, equal?, strict-equal?, not-equal?, <>.
Use op? to check if a value is of the op! datatype.
>> op? :&&
== trueUse type? to return the datatype of a given value.
>> type? :||
== op!