post-scarcity/lisp/expt.lisp
Simon Brooke 02fe5669d8 Complete reworking of the REPL
which is good in itself, but not what I was meant to be working on.
2018-12-30 17:56:15 +00:00

7 lines
190 B
Common Lisp

(set! expt (lambda
(n x)
"Return the value of `n` raised to the `x`th power."
(cond
((= x 1) n)
(t (* n (expt n (- x 1)))))))