Let's dissect plist-get with different kinds of atoms as keys, and try to explain why they work or they don't. Little schemer style.
(plist-get '('directory ":fdsa" 'irc "channel") 'directory) ; nil
Why? The whole plist is is quoted, being a literal list, so if there's no need to re-quote it again.
(plist-get (list 'directory ":fdsa" 'irc "channel") 'directory) ; ":fdsa"
Why? We built the list with the list constructor, so we have to quote the symbol directory. because we want a simbol.
(plist-get '(:directory ":fdsa" 'irc "channel") 'directory) ; nil
Why? :directory is a different symbol from 'directory, and the whole thing is quoted.
(plist-get (list :directory ":fdsa" 'irc "channel") 'directory) ; nil
Why? the plist is not a literal, but again. :directory and 'directory are different things
(plist-get (list :directory ":fdsa" 'irc "channel") :directory) ; ":fdsa"
You see?
(plist-get '(:directory ":fdsa" 'irc "channel") :directory) ; ":fdsa"
And this is again correct. Makes sense, no?
Then, the relation between :foo and 'foo is none, but (eq :foo ':foo) is t.
No hay comentarios:
Publicar un comentario