Created
June 6, 2014 13:09
-
-
Save jordonbiondo/04de55e433355a2ec7c6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; emacs-lisp-lisp (ell) demmo | |
| (ell | |
| ;; define a global var mapcar that is the typical mapcar function | |
| (setq mapcar | |
| (lambda (fn data) | |
| (print 'hi) | |
| (if (null data) | |
| nil | |
| (cons (fn (car data)) | |
| (mapcar fn (cdr data))))))) | |
| (ell | |
| (let ((plus3 (lambda (x) (+ x 3)))) | |
| (if (= (plus3 10) 13) | |
| (elldo | |
| (print "it's working!") | |
| (print (mapcar plus3 (list 1 2 3))) ;; ell mapcar, will print 'hi 4 times before printing result | |
| (let ((mapcar '(native . mapcar))) | |
| (mapcar plus3 (list 4 5 6))))))) ;; emacs lisp mapcar | |
| ;; output | |
| "it's working!" | |
| hi | |
| hi | |
| hi | |
| hi | |
| (4 5 6) | |
| (7 8 9) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment