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

Lisp is fun!

Name: Alexander Dubček 2015-03-24 6:14

I wrote a toy Lisp interpreter this weekend. Programming is pretty much a video game!

https://bitbucket.org/dhoskin/thp

(LET ((f (LAMBDA (x) (IF (x (f (CDR x))) recursion!))))
(f (QUOTE (a b c d e))))

→ args: ((a b c d e))
→ args: ((b c d e))
→ args: ((c d e))
→ args: ((d e))
→ args: ((e))
→ args: (nil)
→ recursion!

Name: Anonymous 2015-03-25 13:20

>>5

Why is f being defined twice in the LET?
First f is set to a recursive definition (where the if clause doesn't seem to have an else case),
Then g is set to f,
Then f is set to a simple function.

What is that thing supposed to do?

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