Skip to content

Instantly share code, notes, and snippets.

@moratori
Created June 5, 2013 15:20
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 moratori/5714679 to your computer and use it in GitHub Desktop.
Save moratori/5714679 to your computer and use it in GitHub Desktop.
list comprehenison test
(print [x | x <- '(1 2 3)])
(print [(cons x y) | x <- '(1 2 3) y <- '(2 3) ])
(print [(funcall f x) | f <- '(sin cos tan) x <- '(1 2 3 4 5) (evenp x)])
(print [(* x y) | (x y) <- '((1 2) (3 4) (5 6))])
(ql:quickload :alexandria)
(use-package :alexandria)
(print [`(,x ,y ,z)| x <- (iota 10) y <- (iota 10) z <- (iota 10) (= (+ (* 5 x) (* 3 y) (* -6 z)) 13)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment