Skip to content

Instantly share code, notes, and snippets.

@Chemaclass
Created April 18, 2024 20:21
Show Gist options
  • Save Chemaclass/a964412b10a73c0fc251d8e8cd2c0e14 to your computer and use it in GitHub Desktop.
Save Chemaclass/a964412b10a73c0fc251d8e8cd2c0e14 to your computer and use it in GitHub Desktop.
A fibonacci implementation written in phel
(ns phel-testing\local)
(defn fib [n]
(loop [fib-nums [0 1]]
(if (>= (count fib-nums) n)
(slice fib-nums 0 n)
(let [[n1 n2] (reverse fib-nums)]
(recur (push fib-nums (+ n1 n2)))))))
(println (fib 50))
# docs: https://phel-lang.org/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment