Hi Nicolas,
Indeed, withoutSelfLoops should be improved. I went over the archive and dug up my
proposal for the reorganization (to find the overall discussion, search for the subject
"MooseChef scoping should not exclude self loops"):
----
I would prefer to keep the previous separation. In fact, it seems to me that we can obtain
the same results as you have now by simply commenting the reject statement from:
MooseQueryResult>>collectAtScope: aScopeSymbol
| sourceScope |
sourceScope := receiver perform: aScopeSymbol.
^ self newObjectResultWith:
((self primCollectAtScope: aScopeSymbol)
"reject: [ :scope | sourceScope mooseIncludes: scope ]") "exclude self
loops"
This is a tricky change and we should look into it closely. My solution would be to:
- remove the default reject (see above)
- add the receiver to MooseObjectQueryResult
- implement MooseObjectQueryResult>>withoutSelfLoops to use it
----
Cheers,
Doru
On 27 Nov 2011, at 12:17, Nicolas Anquetil wrote:
Hi,
I want to redefine the soft engineering metrics (in famix-extension-metrics) using
MooseChef which is more concise and generic.
But for this I need to remove the implicit withoutSelfLoops from some query.
If anybody has something agains this removal, let him come forth and speak now or remain
silent forever and ever.
Here is an example of how nice MooseChef can be.
Consider:
myClasses collect: [:c | c queryAllOutgoingDependencies atClassScope withinMyPackage]
instead of:
myClasses collect: [:c | (c invokedClasses select: [:invoked | invoked packageScope =
self])
union:
((c superclass isNil not and: [c superclass
packageScope = self])
ifTrue: [{c superclass}]
ifFalse: [#()])]
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"We cannot reach the flow of things unless we let go."