Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.978.mcz ==================== Summary ==================== Name: Tools-mt.978 Author: mt Time: 13 June 2020, 12:12:13.228814 pm UUID: 2b303276-0f03-1643-80da-7a436f6d2f89 Ancestors: Tools-mt.977 In the deps browser, reveal whether there is any class-definition or extension dependency at all as early as possible. Feel free to adjust the labels. For now, they are: 2nd / 3rd pane ... () ... * ... () * ... *exts only ... (defs only) 4th pane: ... (class definition) *extensions =============== Diff against Tools-mt.977 =============== Item was changed: ----- Method: DependencyBrowser>>classDepsList (in category 'class deps') ----- classDepsList "Class dependencies for the currently selected package" + | checkDef checkExt | + checkDef := [:mref | mref selector = #Definition]. + checkExt := [:mref | mref category notNil and: [mref category first = $*]]. + ^ classDepsList ifNil: [ classDepsList := self classDeps. classDepsList := classDepsList collect: [:className | + String streamContents: [:label | + label nextPutAll: className. + (self depsForClassNamed: className allSatisfy: checkDef) + ifTrue: [label nextPutAll: ' (defs only)'] + ifFalse: [(self depsForClassNamed: className allSatisfy: checkExt) + ifTrue: [label nextPutAll: ' *exts only'] + ifFalse: [ + (self depsForClassNamed: className anySatisfy: checkDef) + ifTrue: [label nextPutAll: ' ()']. + (self depsForClassNamed: className anySatisfy: checkExt) + ifTrue: [label nextPutAll: ' *']]]]]]! - (self - depsForClassNamed: className - allSatisfy: [:mref | mref selector = #Definition]) - ifTrue: [className, ' (defs only)'] - ifFalse: [(self - depsForClassNamed: className - allSatisfy: [:mref | mref category notNil and: [mref category first = $*]]) - ifTrue: [className, ' *ext only*'] - ifFalse: [className]]]. - classDepsList]! Item was added: + ----- Method: DependencyBrowser>>depsForClassNamed:anySatisfy: (in category 'enumerating') ----- + depsForClassNamed: className anySatisfy: workBlock + + self + depsForClassNamed: className + do: [:mref | (workBlock value: mref) ifTrue: [^ true]]. + ^ false! Item was added: + ----- Method: DependencyBrowser>>depsForPackageNamed:anySatisfy: (in category 'enumerating') ----- + depsForPackageNamed: packageName anySatisfy: workBlock + + self + depsForPackageNamed: packageName + do: [:mref | (workBlock value: mref) ifTrue: [^ true]]. + ^ false! Item was changed: ----- Method: DependencyBrowser>>packageDepsList (in category 'package deps') ----- packageDepsList "Package dependencies for the currently selected package" + | checkDef checkExt | + checkDef := [:mref | mref selector = #Definition]. + checkExt := [:mref | mref category notNil and: [mref category first = $*]]. + ^ packageDepsList ifNil: [ packageDepsList := self packageDeps. packageDepsList := packageDepsList collect: [:packageName | + String streamContents: [:label | + label nextPutAll: packageName. + (self depsForPackageNamed: packageName allSatisfy: checkDef) + ifTrue: [label nextPutAll: ' (defs only)'] + ifFalse: [(self depsForPackageNamed: packageName allSatisfy: checkExt) + ifTrue: [label nextPutAll: ' *exts only'] + ifFalse: [ + (self depsForPackageNamed: packageName anySatisfy: checkDef) + ifTrue: [label nextPutAll: ' ()']. + (self depsForPackageNamed: packageName anySatisfy: checkExt) + ifTrue: [label nextPutAll: ' *']]]]]]! - (self - depsForPackageNamed: packageName - allSatisfy: [:mref | mref selector = #Definition]) - ifTrue: [packageName, ' (defs only)'] - ifFalse: [(self - depsForPackageNamed: packageName - allSatisfy: [:mref | mref category notNil and: [mref category first = $*]]) - ifTrue: [packageName, ' *ext only*'] - ifFalse: [packageName]]]. - packageDepsList]! |
For example, "BitBlt ()" means that (1) you need it as a base class and (2) you actually reference the class "BitBlt" in your code and (3) you make no extensions to that class. For another example, "Kernel () *" means that (1) you need some class from Kernel package as base class and (2) you add extension methods to at least one class from the Kernel package. It does not reveal whether you reference a class from that Kernel package in your code. For a last example, "Files" means that (1) you reference a class from the Files package and (2) you do not need any class as a base class from there and (3) you do not put extensions into any of those classes from Files. Well, if there would be no hidden dependencies -- but there often are, e.g. Etoys msg sends -- considering modularity, it is preferrable to get rid of "*" and "*exts only" first. Then go for changing "()" into "(defs only)". In any case remove the number of items in the second to fifth panes. :-D Best, Marcel
|
Hi Marcel,
thanks for extending this helpful tool! :-)
Hm, this artificial syntax does not really appear intuitive to me, especially for beginners. You prove this yourself by writing an extra explanation of these symbols. ;-) I would not want myself to need to google what this notation could mean ... There are already too many tools in the dark outside of Squeak that lack a proper self-description.
Couldn't we simply write "Collections (defs+exts)" or maybe "Collection (super) *exts"? Maybe we could also display some helpful hints in the text pane when you select a depending package only.
Or ideally: Use some kind of text attribute to highlight the parts of the source that actually make up dependency. Quick and dirty prototypes:
I think this would make it much easier to use this tool. Just my two cents :-) Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Samstag, 13. Juni 2020 12:23:03 An: squeak-dev Betreff: Re: [squeak-dev] The Trunk: Tools-mt.978.mcz For example, "BitBlt ()" means that (1) you need it as a base class and (2) you actually reference the class "BitBlt" in your code and (3) you make no extensions to that class.
For another example, "Kernel () *" means that (1) you need some class from Kernel package as base class and (2) you add extension methods to at least one class from the Kernel package. It does not reveal whether you reference a class from that Kernel package
in your code.
For a last example, "Files" means that (1) you reference a class from the Files package and (2) you do not need any class as a base class from there and (3) you do not put extensions into any of those classes from Files.
Well, if there would be no hidden dependencies -- but there often are, e.g. Etoys msg sends -- considering modularity, it is preferrable to get rid of "*" and "*exts only" first. Then go for changing "()" into "(defs only)". In any case remove the number
of items in the second to fifth panes. :-D
Best,
Marcel
Carpe Squeak!
|
Thiede, Christoph <[hidden email]> schrieb am Sa., 13. Juni 2020, 14:58:
In my opinion the Smalltalk tools are also not self-describing. You typically need an introduction to use them, or did you know what those four panes in the browser are for from the very beginning? Or how to create a new method? Most people new to Smalltalk I know were startled that they have to "overwrite" an existing text. That aside, I also think that the embellishments could be more intuitive, Marcel. :-) What does (defs only) even mean? Although that at least has a text ... |
Hi Christoph. "(super)" wouldn't include pool dictionaries. I did not want to spoil the second and third columns with a too lengthy suffix. Hi Jakob. > That aside, I also think that the embellishments could be more intuitive, Marcel. :-) What does (defs only) even mean? Feel free to improve it. ^__^ The current state just reflects the one I required to move forward. Best, Marcel
|
While the labels are not on the intuitive side -- I agree -- one can quickly relate the characters and figure out their meaning. It is not too hard: Best, Marcel
|
By the way a few weeks ago I tried to copy all the packages that a particular package indirectly depends on to another Environment, to have two working copies in one image. Turns out if you just pull in Kernel and Collections you end up with nearly everything from EToys to Nebraska. If you are chasing this same entangledness I may recollect the references and post them. Marcel Taeumel <[hidden email]> schrieb am So., 14. Juni 2020, 08:16:
|
Free forum by Nabble | Edit this page |