Skip to content

Instantly share code, notes, and snippets.

@valvallow
Created February 10, 2010 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valvallow/300107 to your computer and use it in GitHub Desktop.
Save valvallow/300107 to your computer and use it in GitHub Desktop.
10 times say helo.
;; let loop
(let loop ((s 0))
(if (< s 10)
(begin
(print "hello")
(loop (+ 1 s)))))
;; for-each
(use srfi-1)
(for-each
(lambda (i)
(print "hello"))
(iota 10))
;; do
(do ((i 0 (+ i 1)))
((= i 10))
(print "hello"))
;; recursive lambda
((lambda (f)
(f f 10))
(lambda (f n)
(cond
((< 0 n)
(print "hello")
(f f (- n 1))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment