9mm/lib/contains.fnl

8 lines
159 B
Fennel

(fn contains [t x]
(accumulate [found false
_ v (ipairs t)
&until found] ; escape early
(or found (= x v))))
{: contains}