This commit is contained in:
2008-03-21 03:49:53 +00:00
parent f9c7b599d4
commit b52f039c69
358 changed files with 6823 additions and 6288 deletions

21
ase/cmd/awk/lisp/test.scm Normal file
View File

@ -0,0 +1,21 @@
; Sample Scheme code to test scheme.lsp or tail.lsp
(define add-c (lambda (c) (lambda (n) (+ c n))))
(let ((compose (lambda (f g) (lambda (x) (f (g x))))))
((compose (add-c 5) (add-c 3)) 2))
(define Y ; The famous Y combinator!
(lambda (f)
(let ((future
(lambda (future)
(f (lambda (arg)
((future future) arg))))))
(future future))))
((Y (lambda (factorial)
(lambda (n)
(if (= n 0)
1
(* n (factorial (- n 1)))))))
3)