Greetings folks -

I'm experimenting with directed graph possibilites over an inverted index
(of terms in files)

that I've designed. I'm stumbling on the use of the word closure defined
IN: graphs,

using hashtables:


USING: graphs.private kernel ;

IN: graphs

: closure ( obj quot -- assoc )

    H{ } clone [ swap (closure) ] keep ; inline


The article on 'Directed graph utilities' suggests that:


"You can perform queries on the graph:

 closure ( obj quot -- assoc )


Directed graphs are used to maintain cross-referencing information for
Definitions."


I want to implement just such cross-referencing & querying with my inverted
index graph.

It seems there are no example usages of the graphs-vocab closure, but there
is a dopplegänger

definition of closure IN: classes.private, which appears to do the same
work using hash-sets:


USING: kernel ;

IN: classes.private

: closure ( obj quot -- set )

    HS{ } clone [ swap (closure) ] keep ; inline


I find the only(?) example use of the classes.private closure is in the
definition of class-usages,

which is opaque to me. I can't suss out what the construction
sets:membersthere is doing.

Although the recursive (closure) in its def has an obvious analogue in
graph's (closure), both

are a mite hairy.


Can anyone soothe my perplexity with an illustration using closure on a
directed graph?

Much obliged,

~cw
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to