9mm/lib/contains.fnl

8 lines
159 B
Plaintext
Raw Normal View History

2024-05-28 21:04:00 +00:00
(fn contains [t x]
(accumulate [found false
_ v (ipairs t)
&until found] ; escape early
(or found (= x v))))
{: contains}