hi clojure-community,
yesterday i came across the following use of
the delay-macro:
(defn pooled-data-source
[db-connection-settings]
; this Fn creates and returns object of type PooledDataSource
)
(defn pooled-data-source-as-singleton
[db-connection-settings]
(let [datasource (delay (pooled-data-source db-connection-
settings))]
@datasource))
i am not sure, what the exact semantic of this is and if
it's safe in a multithreaded context.
What is the difference to using def/defonce ?
Someone who can explain ?
thanks & have a nice time
--
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