Skip to content

Instantly share code, notes, and snippets.

@delihiros
Created December 15, 2011 17:55
Show Gist options
  • Save delihiros/1482085 to your computer and use it in GitHub Desktop.
Save delihiros/1482085 to your computer and use it in GitHub Desktop.
(define foo
(lambda (n lst)
(if (zero? n) '()
(cons (cons n lst) (foo (- n 1) lst)))))
;; MIT Scheme
;; (foo 4 '(4))
;; ==> ((4 4) (3 4) (2 4) (1 4))
;; Gauche (and my env)
;; (foo 4 '(4))
;; ==> ((4 . #0=(4)) (3 . #0#) (2 . #0#) (1 . #0#))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment