Last active
January 7, 2019 05:45
-
-
Save xuchunyang/8710ba9d0816f096bf8f to your computer and use it in GitHub Desktop.
This file contains 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
(setf (buffer-string) (buffer-name)) | |
(setf (mark) 10 | |
(point) 20) | |
(setq my-list '(0 1 2 3 4 5)) | |
(cl-letf ((my-list)) | |
(message "%s" my-list)) ;; ==> "(0 1 2 3 4 5)" | |
(let ((my-list)) | |
(message "%s" my-list)) ;; ==> "nil" | |
(cl-letf (((car my-list) 1000) | |
((elt my-list 3) 200)) | |
(message "%s" my-list)) ;; ==> "(1000 1 2 200 4 5)" | |
(cl-letf (((symbol-function 'message) #'ignore)) | |
(message "hi")) ;; ==> nil | |
;; hello |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment