Hi Nicholas,<div><br></div><div> IMO you're going to far here. Make selectors send the asSet to insulate the system from this. keys answering an Array is OK, but selectors not answering a set is going to break lots and lots of code.<br>
<br><div class="gmail_quote">On Tue, Oct 20, 2009 at 12:50 PM, <span dir="ltr"><<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Nicolas Cellier uploaded a new version of Traits to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Traits-nice.237.mcz" target="_blank">http://source.squeak.org/trunk/Traits-nice.237.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Traits-nice.237<br>
Author: nice<br>
Time: 20 October 2009, 9:50:34 am<br>
UUID: 53b4311b-7ab7-4f8a-bd01-7320dc813f66<br>
Ancestors: Traits-nice.236<br>
<br>
Track selectors usage, use #asSet where due<br>
<br>
=============== Diff against Traits-nice.236 ===============<br>
<br>
Item was changed:<br>
----- Method: TCompilingBehavior>>selectors (in category 'accessing method dictionary') -----<br>
selectors<br>
+ "Answer a collection of all the message selectors specified in the receiver's<br>
- "Answer a Set of all the message selectors specified in the receiver's<br>
method dictionary."<br>
<br>
^ self methodDict keys!<br>
<br>
Item was changed:<br>
----- Method: TPureBehavior>>ensureLocalSelectors (in category 'traits') -----<br>
ensureLocalSelectors<br>
"Ensures that the instance variable localSelectors is effectively used to maintain<br>
the set of local selectors.<br>
This method must be called before any non-local selectors are added to the<br>
method dictionary!!"<br>
<br>
self basicLocalSelectors isNil<br>
+ ifTrue: [self basicLocalSelectors: self selectors asSet]!<br>
- ifTrue: [self basicLocalSelectors: self selectors]!<br>
<br>
Item was changed:<br>
----- Method: TCompilingBehavior>>crossReference (in category 'user interface') -----<br>
crossReference<br>
"Answer an Array of arrays of size 2 whose first element is a message selector in the receiver's method dictionary and whose second element is a set of all message selectors in the method dictionary whose methods send a message with that selector. Subclasses are not included."<br>
<br>
+ ^self selectors asArray sort collect: [:x | Array<br>
- ^self selectors asSortedCollection asArray collect: [:x | Array<br>
with: (String with: Character cr), x<br>
with: (self whichSelectorsReferTo: x)]<br>
<br>
"Point crossReference."!<br>
<br>
<br>
</blockquote></div><br></div>