Oh, I see (ns mire.rooms ... in rooms.clj Also see (def *rooms* ...) So we can refer in other name spaces the vars and functions in this ns? Like mire.rooms/*rooms*, mire.rooms/*items*, mire.rooms/make-room etc?
Thanks -sun On Jan 28, 1:18 pm, wubbie <sunj...@gmail.com> wrote: > The notation mire.rooms/ is new, especially dod(.) and slash(/). > mire.rooms is rooms in ns mire, etc? > > -sun > > On Jan 28, 12:50 pm, Phil Hagelberg <p...@hagelb.org> wrote: > > > wubbie <sunj...@gmail.com> writes: > > > @mire.rooms/*rooms* is new to me. > > > could anybody explain to me? > > > Sure thing. *rooms* is a ref in the mire.rooms namespace. So since we > > haven't used "refer" or "use" to draw all everything from mire.rooms > > into the current namespace, we prefix the var with its namespace to > > refer to it. And then the "@" before it simply means deref. > > > In summary: get the value of the ref named *rooms* in the mire.rooms > > namespace. > > > > (binding [*name* (read-name) > > > *inventory* (ref []) > > > *current-room* (ref (@mire.rooms/*rooms* :start))] > > > In this case *rooms* is a ref that refers to a map, so we're looking up > > :start in that map and setting the *current-room* ref to that value. > > > -Phil > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---