[ENH] printName

Levente Mészáros melevy at freemail.hu
Sat Feb 26 13:28:05 PST 2005


Hi all,

I think we should consider enhancing the printName facility. Although I don't have concrete suggestions for the names, but I do have for the things which should have separate names.
I did the following naming test:

object@(Root traits) setPrintName: name
[
	object addImmutableSlot: #printName valued: name.
].
object@(Root traits) setPrintNames: name
[
	object setPrintName: name.
	object traits setPrintName: (name ; ' shared behavior').
	object traitsWindow setPrintName: (name ; ' ???').
].

MapComposition setPrintNames: 'MapComposition'.
Mapping setPrintNames: 'Mapping'.
Cloneable setPrintNames: 'Cloneable'.
Derivable setPrintNames: 'Derivable'.
Root setPrintNames: 'Root'.

Having this naming scheme (of course it would be done by addPrototype:) and a small slate program I could do the following:

Slate 1> load: 'src/plugins/ing/ing.slate'.
Loading 'src/plugins/ing/ing.slate'
Nil
Slate 2> Ing collectFrom: MapComposition.
digraph g {
node[shape=record];
10[label="{Cloneable shared behavior|10}"];
11[label="{Cloneable ???|11}"];
1[label="{Root shared behavior|1}"];
2415543[label="{MapComposition|2415543}"];
2873333[label="{MapComposition ???|2873333}"];
7910635[label="{MapComposition shared behavior|7910635}"];
7[label="{Derivable shared behavior|7}"];
3337578[label="{Mapping shared behavior|3337578}"];
2415543 -> 2873333[label="{traitsWindow|329}"];
2873333 -> 11[label="{traitsWindow|329}"];
11 -> 11[label="{traitsWindow|329}"];
11 -> 1[label="{traits2|465}"];
1 -> 11[label="{traitsWindow|329}"];
11 -> 7[label="{traits1|383}"];
7 -> 11[label="{traitsWindow|329}"];
11 -> 10[label="{traits|349}"];
10 -> 11[label="{traitsWindow|329}"];
2873333 -> 1[label="{traits4|615}"];
2873333 -> 7[label="{traits3|625}"];
2873333 -> 10[label="{traits2|465}"];
2873333 -> 3337578[label="{traits1|383}"];
3337578 -> 11[label="{traitsWindow|329}"];
2873333 -> 7910635[label="{traits|349}"];
7910635 -> 11[label="{traitsWindow|329}"];
}
Nil
Slate 3> MapComposition.
("MapComposition" traitsWindow: ("MapComposition ???" traitsWindow: ("Cloneable ???" ...).
        traits4: ("Root shared behavior" ...). traits3: ("Derivable shared behavior" ...).
        traits2: ("Cloneable shared behavior" ...). traits1: ("Mapping shared behavior" ...).
        traits: ("MapComposition shared behavior" ...). printName: 'MapComposition ???').
    base: ("Mapping ???" traitsWindow: ("Mapping ???" ...)). diff: Nil. printName: 'MapComposition')

Slate 4>

The graph above can be drawn via GraphViz, see attachment. I think the names written on the console for MapComposition looks better.
What do you think?

- levy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ing.gif
Type: image/gif
Size: 20033 bytes
Desc: not available
Url : /archives/slate/attachments/20050226/a12e08ea/ing.gif


More information about the Slate mailing list