Skip to content

Instantly share code, notes, and snippets.

@leo60228
Last active December 16, 2020 14:52
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 leo60228/ab68f365a10f6c218a31a3a7b7882280 to your computer and use it in GitHub Desktop.
Save leo60228/ab68f365a10f6c218a31a3a7b7882280 to your computer and use it in GitHub Desktop.
(fn first [pred iter inv control]
(let [(control value) (iter inv control)]
(if (= value nil)
nil
(pred value)
value
(first pred iter inv control))))
(fn even [x]
(= (% x 2) 0))
(print (first even (ipairs [1 2 3])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment