Lisp Fixed - Tlen

defn factorial n if <= n 1 1 * n factorial - n 1 .

(example-tlen-usage)

If you're looking for how to get the length of a list in Lisp, here's a simple example using Common Lisp: tlen lisp

In the beginning, there was the Cons, and the Cons was nil . But nil is heavy. nil takes up space. Enter . defn factorial n if &lt;= n 1 1 * n factorial - n 1

The compiler infers types but never enforces them unless you ask via (check-types!) . defn factorial n if &lt

; Define the function 'fade' ; n: the starting integer let fade n print n