Skip to content

Instantly share code, notes, and snippets.

@kana
Created April 28, 2010 21:22
Show Gist options
  • Save kana/382741 to your computer and use it in GitHub Desktop.
Save kana/382741 to your computer and use it in GitHub Desktop.
; Q. Is there more polished form to write this procedure?
(let1 f (lambda (x y) (cons x y)) ; Actually, f is an arbitrary procedure.
(map (lambda (outer-element)
(map (lambda (inner-element)
(f inner-element outer-element))
'(a b c)))
'(1 2 3)))
; ==> ((a . 1) (b . 1) (c . 1)
; (a . 2) (b . 2) (c . 2)
; (a . 3) (b . 3) (c . 3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment