[mcclim-devel] question about implementation detail in format-graph-from-roots
rpgoldman at real-time.com
rpgoldman at real-time.com
Tue Jul 26 00:49:48 UTC 2005
Some questions about the implementation details:
1. I was just noticing that the hash-table that is used for duplicate
detection is only used in the generate-graph-nodes method, but is kept
as a slot in standard-graph-output-record. Is there any reason I
shouldn't turn this into a local variable in generate-graph-nodes?
I'm concerned that, for large graphs, this could end up being a pretty
large piece of uncollectable garbage. It might be even worse if the
duplicate-test argument forces us to have a node list instead of a
hash-table.
I suppose if I do this, then we might get away with not keeping
duplicate-test and duplicate-key in the graph-output-record objects,
either...
2. Can anyone explain to me why :duplicate-test and :duplicate-key
are keyword arguments to generate-graph-nodes but :merge-duplicates is
not? Seems odd...
3. The existing code has the following lambda list for
FORMAT-GRAPH-FROM ROOTS:
(root-objects object-printer inferior-producer
&rest graph-options
&key stream orientation cutoff-depth
merge-duplicates duplicate-key duplicate-test
generation-separation
within-generation-separation
center-nodes
(arc-drawer #'clim-internals::standard-arc-drawer)
arc-drawing-options
graph-type (move-cursor t)
&allow-other-keys)
then has the following immediately below:
(setf stream (or stream *standard-output*)
graph-type (or graph-type (if merge-duplicates :digraph :tree))
duplicate-key (or duplicate-key #'identity)
duplicate-test (or duplicate-test #'eql) )
Could we have duplicate-key and duplicate-test simply get their
defaults in the lambda-list? Or is this not feasible because of the
GRAPH-OPTIONS &rest argument?
Thanks,
Robert
More information about the mcclim-devel
mailing list