On 7 March 2011 14:05, icemaze <icem...@gmail.com> wrote:
> 1) Was this necessary at all? Can my requirements be fulfilled with
> off-the-shelf clojure libraries or components? Requirements include
> the ability to merge objects as shown below.

It looks like you're trying to group together different functionality
in one place. Idiomatic Clojure tends to encourage separating
functionality out into independent components.

Your example indicates your defobject system is providing validation
and default values. You may be able to split this up into individual
functions. For example:

  (defn default [m k v]
    (if (nil? (m k))
      (assoc m k v)
      m))

  (defn mobile-defaults [mobile]
    (-> mobile
        (default :warranty 3)
        (default :on-contract? true)))

But without knowing more about your system it's hard to offer any more
specific advice.

- James

-- 
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