Skip to content

Instantly share code, notes, and snippets.

@hyotang666
Created June 6, 2019 14:20
Show Gist options
  • Save hyotang666/d1b6f36ff1ea3efe286bb74f5b861281 to your computer and use it in GitHub Desktop.
Save hyotang666/d1b6f36ff1ea3efe286bb74f5b861281 to your computer and use it in GitHub Desktop.
(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