Nicolas Cellier uploaded a new version of Traits to project The Trunk:
http://source.squeak.org/trunk/Traits-nice.237.mcz ==================== Summary ==================== Name: Traits-nice.237 Author: nice Time: 20 October 2009, 9:50:34 am UUID: 53b4311b-7ab7-4f8a-bd01-7320dc813f66 Ancestors: Traits-nice.236 Track selectors usage, use #asSet where due =============== Diff against Traits-nice.236 =============== Item was changed: ----- Method: TCompilingBehavior>>selectors (in category 'accessing method dictionary') ----- selectors + "Answer a collection of all the message selectors specified in the receiver's - "Answer a Set of all the message selectors specified in the receiver's method dictionary." ^ self methodDict keys! Item was changed: ----- Method: TPureBehavior>>ensureLocalSelectors (in category 'traits') ----- ensureLocalSelectors "Ensures that the instance variable localSelectors is effectively used to maintain the set of local selectors. This method must be called before any non-local selectors are added to the method dictionary!!" self basicLocalSelectors isNil + ifTrue: [self basicLocalSelectors: self selectors asSet]! - ifTrue: [self basicLocalSelectors: self selectors]! Item was changed: ----- Method: TCompilingBehavior>>crossReference (in category 'user interface') ----- crossReference "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." + ^self selectors asArray sort collect: [:x | Array - ^self selectors asSortedCollection asArray collect: [:x | Array with: (String with: Character cr), x with: (self whichSelectorsReferTo: x)] "Point crossReference."! |
Hi Nicholas,
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.
On Tue, Oct 20, 2009 at 12:50 PM, <[hidden email]> wrote: Nicolas Cellier uploaded a new version of Traits to project The Trunk: |
Free forum by Nabble | Edit this page |