On Jun 14, 12:05 pm, gaz jones <gareth.e.jo...@gmail.com> wrote:
> if i was writing the java i would probably do a "tell dont ask"
> refactoring so that the operations had an applyTo method:
>
> List<Item> items = initialItems ();
>
> for (Op op : operations)
> {
>   op.applyTo(items);
>
> }
>
> not sure what your op data structure is, but i would image you could
> translate that to the clojure code also -- is that reasonable?

I think you're right that the above is a better OO design, but that
was really just a Java translation of the sort of think I'd like to do
in Clojure (minus the mutable list).

The ops in this case have abstract meaning (they are [source target
delta] tuples describing list transformations), and attaching
"methods" to them (presumably as fn's) in this case would be weird I
think, as well as requiring a switch from tuples to maps or records.

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