Created
January 11, 2014 10:25
-
-
Save ktakashi/8369222 to your computer and use it in GitHub Desktop.
Case insensitive intern
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
(defun my-intern (s &rest package) | |
(declare (type string s) | |
(type symbol package) | |
(optimize (debug 0) (speed 3) (safety 0))) | |
(let ((readtable-case (readtable-case *readtable*))) | |
(apply #'intern (case readtable-case | |
((:upcase) (string-upcase s)) | |
((:downcase) (string-downcase s)) | |
((:preserve) s) | |
((:invert) ;; lazy.. | |
(error ":invert is not supported"))) | |
package))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment