>
> What should I be using to check that the symbol .firstName and
> .fullName are defined in the current scope?
>
"fullName" is easier because it gets interned in the current namespace:
user=> (ns-interns 'user)                                
{fullName #'user/fullName, ->Person #'user/->Person, Named #'user/Named}
user=> (resolve 'fullName)  ; no leading dot                            
#'user/fullName

For the fields in types you'll need reflection:
user=> (use 'clojure.reflect)      
user=> (pprint (:members (reflect Person)))
#{ ... some stuff deleted...
  {:name firstName,
   :type java.lang.Object,
   :declaring-class user.Person,
   :flags #{:public :final}}
  {:name lastName,
   :type java.lang.Object,
   :declaring-class user.Person,
   :flags #{:public :final}}

   ... some other stuff deleted...
}

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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

Reply via email to