Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Factorial in LISP

Name: Anonymous 2011-02-05 13:59


factorial 1->1; n->n*(factorial n-1)


compare to Haskell

factorial::Integer->Integer
factorial 0=1
factorial n=n*factorial(n-1)

Name: code less, create more 2011-02-05 16:51

>>27
Lisp:

f 1->1; n->n*(f n-1)

Forth:

: f 1+ 1 tuck +do i * loop ;

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List