Skip to content

Instantly share code, notes, and snippets.

@smihica
Created December 15, 2011 06:10
Show Gist options
  • Save smihica/1480016 to your computer and use it in GitHub Desktop.
Save smihica/1480016 to your computer and use it in GitHub Desktop.
lambda短縮マクロ ref: http://qiita.com/items/1380
;; #[+ 1 2]
;; => #'(lambda () (+ 1 2))
;;
;; #[+ _ 1]
;; => #'(lambda (_) (+ _ 1))
;;
;; #[if (< _0 10) (+ _1 2) (+ (- 100 _0) _2)]
;; => #'(lambda (_0 _1 _2) (if (< _0 10) (+ _1 2) (+ (- 100 _0) _2)))
> (funcall #[+ 10 100])
; 110
> (funcall #[+ _ 100] 1)
; 101
> (mapcar #[list _0 _1 _2] '(1 2 3) '(4 5 6) '(7 8 9))
;((1 4 7) (2 5 8) (3 6 9))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment