Hello All,
>> What is the right way to do this?
> (defn new-container
> [type]
> (.newInstance (*containers* type)))
> (defmacro new-container [type]
> `(new ~(*containers* type)))
Thanks! These are both great and also very educational.
The reason for this coding style is that I'm writing a wrapper around
webdriver, and I'd like a factory function to create a driver for a
specific browser.
(def *drivers* {
:firefox FirefoxDriver
:ie InternetExplorerDriver })
(defn new-driver
"create new driver"
[browser]
(.newInstance (*drivers* browser)))
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en