Created
April 29, 2010 23:12
-
-
Save RTfXGaGeqSeItbMUgpFlekUs/384428 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Welcome to Clozure Common Lisp Version 1.5-r13651 (DarwinX8664)! | |
? (load "/Users/martin/Desktop/Untitled.lisp") | |
#P"/Users/martin/Desktop/Untitled.lisp" | |
? (fact 10) | |
3628800 | |
? (fact 0) | |
1 | |
? (fact-gen nil) | |
#<COMPILED-LEXICAL-CLOSURE (:INTERNAL FACT-GEN) #x302000F7BB5F> | |
? (funcall (fact-gen nil) 0) | |
1 | |
? (funcall (fact-gen (fact-gen nil)) 1) | |
1 | |
? (funcall (fact-gen (fact-gen (fact-gen nil))) 1) | |
1 | |
? (funcall (fact-gen (fact-gen (fact-gen nil))) 2) | |
2 | |
? (funcall (fact-gen (fact-gen (fact-gen (fact-gen nil)))) 3) | |
6 | |
? (funcall (fact-gen (fact-gen (fact-gen (fact-gen (fact-gen (fact-gen (fact-gen (fact-gen | |
(fact-gen (fact-gen (fact-gen nil))))))))))) 10) | |
3628800 | |
? (fact 10) | |
3628800 | |
? (funcall (fact-gen (fact-gen (fact-gen (fact-gen (fact-gen (fact-gen (fact-gen (fact-gen | |
(fact-gen (fact-gen (fact-gen nil))))))))))) 11) | |
> Error: NIL is not of type (OR SYMBOL FUNCTION), and can't be FUNCALLed or APPLYed | |
> While executing: (:INTERNAL FACT-GEN), in process Listener(8). | |
> Type cmd-. to abort, cmd-\ for a list of available restarts. | |
> Type :? for other options. | |
1 > :q | |
? (funcall (Y #'fact-gen) 10) | |
3628800 | |
? (funcall (Y #'fact-gen) 100) | |
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 | |
? ; Y Combinators are fun! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment