On Jan 15, 5:59 am, Laurent PETIT <laurent.pe...@gmail.com> wrote:
> I would like to know, is there an essential reason for not having
> stored the dependency graph as a hidden property of the graph ?

I'm not sure I understand your question. You can see the stored graph
if you take the function returned by dg/make-dgraph and call it
without any arguments. I consider that an implementation detail,
though.

The dependency graph returned by dg/make-graph is a closure rather
than a data structure mainly to allow shortcut syntax for accessing
and "setting" node values: (my-dgraph :my-node) is just a function
call. So is (my-dgraph :my-node new-node-value). If my-dgraph was not
a function, there would have to be a more verbose calling convention.
(Reader macro support in Clojure would have taken away some of the
verbosity.)

> Do you have examples of where you see it interesting to use (and not
> abuse :-) ) side effects in combination with eager/patient ?

I just checked in a Swing usage example which uses side effects to
update the UI (http://github.com/gcv/dgraph/blob/master/src/examples/
dgraph/swing.clj). Please let me know if it makes sense. I hope the
concept is useful outside of just making Swing programming less
agonizing, though. :)

> Are there implicit hypothesis (not yet documented ? or maybe I
> overlooked) on the types that can be used for the keys of the graph ?

Not particularly, no. I have always used keywords, so they are best-
tested. Even so, any type usable as a key in a normal Clojure map
should work. If you find something not working with another type,
definitely let me know, and I'll try to fix it.

> For those of use who do not know cl cells, would it be easy to explain
> in which area it differs ?

Cells the Common Lisp library lets you put slots of CLOS objects on a
dependency graph. Put another way, any slot in any CLOS object can
become a node on the graph. The Clojure dgraph library isolates the
entire dependency graph in a separate, immutable data structure.
Clojure cannot readily adopt the Cells way of doing things, because it
has no CLOS and no meta-object protocol. dgraph also tries to at allow
and even encourage purely functional use, in spite of its usefulness
in side-effect-ridden UI code. Cells is more imperative in nature.

Thanks for your interest in dgraph!
-- 
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