Skip to content

Instantly share code, notes, and snippets.

@toomasv
Created July 6, 2019 04:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toomasv/dcb21b924653c5d69855b032f0387115 to your computer and use it in GitHub Desktop.
Save toomasv/dcb21b924653c5d69855b032f0387115 to your computer and use it in GitHub Desktop.
Check containment in series
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