Skip to content

Instantly share code, notes, and snippets.

@vito
Created September 2, 2010 21:16
Show Gist options
  • Save vito/562966 to your computer and use it in GitHub Desktop.
Save vito/562966 to your computer and use it in GitHub Desktop.
alex@alex-laptop:~/the$ the
> [] includes?: _ := False
@defined
> (xs: List) includes?: y := if: (xs (take: y length) == y) then: { True } else: { xs tail includes?: y }
@defined
> [1, 2, 3, 4, 5] includes?: [2, 3]
True
> [1, 2, 3, 4, 5] includes?: [2, 4]
False
> "restaurant" includes?: "aura"
True
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment