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: Anonymous 2011-02-07 11:41

Imagine a giant cudder flying towards your dotted pair, and there's nothing you can do about it. And you're like "Oh man, I'm gonna have to cons this thing", and you brace yourself to cons this giant cudder. But then, at the last moment, it changes trajectory and hits you in the car. You think to yourself "Well, at least I got that out of the way", but then the giant cudder rears back and gets assigned to the car again, and again, and again. Eventually, this giant car is penetrating your dotted pair, and you begin to lose control over your memory management. That's when the giant cudder foldrs into a single value, causing your stack to overflow. Unable to move and at your most vulnerable, the giant cudder finally lodges itself in your list, where it rests uncomfortable for 4, maybe 5 hours. That's what using Lisp is like.

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