Skip to content

Instantly share code, notes, and snippets.

@greggirwin
Last active March 27, 2017 17:31
Show Gist options
  • Save greggirwin/257592d854db222dfba021052b5dc34a to your computer and use it in GitHub Desktop.
Save greggirwin/257592d854db222dfba021052b5dc34a to your computer and use it in GitHub Desktop.
Infix operator you can use like ANY for two args.
Red []
a-or-b: function [a b][any reduce [a b]]
|: make op! :a-or-b
example: {
>> a-or-b: function [a b][any reduce [a b]]
== func [a b][any reduce [a b]]
>> |: make op! :a-or-b
== make op! [[a b]]
>> 1 | 2
== 1
>> none | 2
== 2
>> set [w x y z] [none none none 4]
== [none none none 4]
>> w | x | y | z
== 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment