Created
September 14, 2018 17:13
-
-
Save danhodge/8e728253cd72eccbda0fa927d765809a to your computer and use it in GitHub Desktop.
Emacs LISP Scratchpad
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
| ; Trying to figure out how namespaced elisp functions work: https://www.greghendershott.com/2017/02/emacs-themes.html | |
| (defun dh/foo (x) | |
| "adds 4 to x" | |
| (+ x 4)) | |
| (dh/foo 1) | |
| (defun dh/bar (x, fn) | |
| "adds 5 to fn(x)" | |
| (+ 5 (fn x))) | |
| (dh/bar 7 #'dh/foo) | |
| ; Trying to figure out how to pass functions in elisp | |
| (defun plus1 (x) (+ 1 x)) | |
| (defun callfn (fn, x) (fn x)) | |
| (callfn (lambda() plus1) 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment