Last active
June 10, 2018 19:38
-
-
Save gosukiwi/f244f4f455f9b40d4da5c51bec1a903a to your computer and use it in GitHub Desktop.
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
;; a plist associating keywords with functions | |
(defvar *commands* | |
'(:title title-command)) | |
(defun title-command (params) | |
(format t "Title command function. Params: ~A" params)) | |
;; I want to read the keyword from the CLI, but it's a char array | |
;; how can I cast it to keyword? | |
(apply (getf *commands* (read-line)) '(1 2 3)) | |
;; using (intern (read-line) "KEYWORD") doesn't work | |
;; NOTE: I want to input `title`in the CLI, not `:title`. | |
(getf *commands* (intern (read-line) "KEYWORD")) ;; => This returns NIL even if I type "title" |
informatimago
commented
Jun 10, 2018
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment