Hi Tim, thanks for the feedback!
On Feb 21, 11:16 am, Timothy Pratley <timothyprat...@gmail.com> wrote: > (1) auto-agents by SS in contrib has a more convenient syntax [maybe > you can mimic it] Agreed, it is nicer. At the moment 'def-cell' is already a stretch for me, but maybe someday I'll get there. :) > (2) I can add a watcher to one of your cells - it wont do anything > unless evaluate is called. I can see the advantage of not calculating > needlessly, but if it is not going to be updated dynamically it is a > bit misleading to allow watchers. The cell changes to {:needs-update true} as soon as one of its ancestors changes (plus the time it takes for the messages to propagate). Watchers could make use of that information, no? > (3) I don't see the need for agents and watcher for lazy cells, after > all can't they just be formula which are evaluated/updated in the > correct order? I have a feeling this would be more efficient (seeing > that is your goal). It's the concurrency. If you have a cell setup like (def a (agent 0)) (def-cell b fn [a]) (def-cell c fn [a]) the agent-based implementation allows b and c can update concurrently, whereas if they were just formulas they would of course have to update sequentially. Or do you have some clever use of pmap in mind? Either way, I'm planning on using this for cells whose update functions involve reasonably heavy number-crunching, so I'm hoping that the concurrency will be worth the overhead it requires. However the overhead in my implementation is admittedly substantial... I couldn't figure out a way to keep the number of updates to a minimum yet keep the updates concurrent that required less than two watchers per cell. > (4) Both lazy and watchable cells are useful. Good point... and come to think of it, there's no reason why these cells shouldn't be able to mix with Stuart Sierra's auto-agents, given that they're both just agents with watchers. > (5) id? could be just: instance? IDeref x unless I'm missing > something Thanks for the tip! > (6) case macro - not used in the code, and doesn't cond suffice? You're right, as of version two case is officially cruft, and anyway cond does the same job. No problem, it was good macro practice. :-) That was very helpful, I appreciate it! Please pass along any other thoughts on this. Anand --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---