Created
July 6, 2019 04:45
-
-
Save toomasv/dcb21b924653c5d69855b032f0387115 to your computer and use it in GitHub Desktop.
Check containment in series
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [ | |
Date: 2019-07-06 | |
Author: "Toomas Vooglaid" | |
Motivation: https://gitter.im/red/help?at=5d20178fc5f3c329aef31f43 | |
] | |
includes?: func [ | |
"Check if first argument contains any of second argument" | |
a [series!] | |
b [any-type!] | |
][ | |
either series? :b [ | |
if not same? type? :a type? :b [b: to type? :a :b] | |
not empty? intersect a b | |
][to-logic find a b] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment