fad*_*bee 1 symbols clojure quote
为什么http://www.lisperati.com/clojure-spels/data.html使用带引号的符号而不是关键字?
(def objects '(whiskey-bottle bucket frog chain))
(def game-map (hash-map
'living-room '((you are in the living room
of a wizards house - there is a wizard
snoring loudly on the couch -)
(west door garden)
(upstairs stairway attic))
'garden '((you are in a beautiful garden -
there is a well in front of you -)
(east door living-room))
'attic '((you are in the attic of the
wizards house - there is a giant
welding torch in the corner -)
(downstairs stairway living-room))))
(def object-locations (hash-map
'whiskey-bottle 'living-room
'bucket 'living-room
'chain 'garden
'frog 'garden))
(def location 'living-room)
(defn describe-location [location game-map]
(first (location game-map)))
Run Code Online (Sandbox Code Playgroud)
我改变了'living-room对:living-room所有地方和它的工作.
我对Clojure很新 - 有什么意义'something,什么时候:something可以使用?
(我理解引用的作用 - 我想知道何时使用带引号的符号而不是关键字.)