Created
June 6, 2019 14:20
-
-
Save hyotang666/d1b6f36ff1ea3efe286bb74f5b861281 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
(ql:quickload :split-sequence) | |
(defun |#!-reader|(stream char number) | |
(declare(ignore char number)) | |
(let((symbol(read stream t t t))) | |
(check-type symbol symbol) | |
(let((methods(split-sequence:split-sequence #\. (symbol-name symbol)))) | |
(assert(eql 2 (length methods))) | |
`(lambda(&rest args) | |
(apply ',(intern (cadr methods)) | |
,(intern (car methods)) | |
args))))) | |
(defun enable() | |
(set-dispatch-macro-character #\# #\! '|#!-reader|)) | |
#| | |
(let((string "hoge")) | |
(#!string.length)) | |
; => 4 | |
|# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment