The Trunk: Protocols-pre.62.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Protocols-pre.62.mcz

commits-2
Patrick Rein uploaded a new version of Protocols to project The Trunk:
http://source.squeak.org/trunk/Protocols-pre.62.mcz

==================== Summary ====================

Name: Protocols-pre.62
Author: pre
Time: 7 May 2019, 12:09:35.44983 pm
UUID: db63a735-b9ea-6442-9048-022830af513e
Ancestors: Protocols-cmm.61

Replaces calls to the deprecated #upTo: with #copyUpTo: in the lexicon browser

=============== Diff against Protocols-cmm.61 ===============

Item was changed:
  ----- Method: Lexicon>>displaySelector: (in category 'basic operation') -----
  displaySelector: aSelector
  "Set aSelector to be the one whose source shows in the browser.  If there is a category list, make it highlight a suitable category"
 
  | detectedItem messageIndex |
  self chooseCategory: (self categoryDefiningSelector: aSelector).
  detectedItem := messageList detect:
+ [:anItem | (anItem asString copyUpTo: Character space) asSymbol == aSelector] ifNone: [^ Beeper beep].
- [:anItem | (anItem asString upTo: $ ) asSymbol == aSelector] ifNone: [^ Beeper beep].
  messageIndex := messageList indexOf: detectedItem.
  self messageListIndex: messageIndex!

Item was changed:
  ----- Method: Lexicon>>selectSelectorItsNaturalCategory: (in category 'selection') -----
  selectSelectorItsNaturalCategory: aSelector
  "Make aSelector be the current selection of the receiver, with the category being its home category."
 
  | cat catIndex detectedItem |
  cat := self categoryOfSelector: aSelector.
  catIndex := categoryList indexOf: cat ifAbsent:
  ["The method's own category is not seen in this browser; the method probably occurs in some other category not known directly to the class, but for now, we'll just use the all category"
  1].
  self categoryListIndex: catIndex.
  detectedItem := messageList detect:
+ [:anItem | (anItem asString copyUpTo: Character space) asSymbol == aSelector] ifNone: [^ self].
- [:anItem | (anItem asString upTo: $ ) asSymbol == aSelector] ifNone: [^ self].
  self messageListIndex:  (messageList indexOf: detectedItem ifAbsent: [^ self])!

Item was changed:
  ----- Method: Lexicon>>selectWithinCurrentCategory: (in category 'selection') -----
  selectWithinCurrentCategory: aSelector
  "If aSelector is one of the selectors seen in the current category, select it"
 
  | detectedItem |
  detectedItem := self messageList detect:
+ [:anItem | (anItem asString copyUpTo: Character space) asSymbol == aSelector] ifNone: [^ self].
- [:anItem | (anItem asString upTo: $ ) asSymbol == aSelector] ifNone: [^ self].
  self messageListIndex:  (messageList indexOf: detectedItem ifAbsent: [^ self])!

Item was changed:
  ----- Method: Lexicon>>selectorsSendingSelectedSelector (in category 'senders') -----
  selectorsSendingSelectedSelector
  "Assumes lastSendersSearchSelector is already set"
  | selectorSet |
+ autoSelectString := (self lastSendersSearchSelector copyUpTo: $:) asString.
- autoSelectString := (self lastSendersSearchSelector upTo: $:) asString.
  selectorSet := Set new.
  (self systemNavigation allCallsOn: self lastSendersSearchSelector)
  do: [:anItem | | sel cl |
  sel := anItem methodSymbol.
  cl := anItem actualClass.
  ((currentVocabulary
  includesSelector: sel
  forInstance: self targetObject
  ofClass: targetClass
  limitClass: limitClass)
  and: [targetClass includesBehavior: cl])
  ifTrue: [selectorSet add: sel]].
  ^ selectorSet sorted!

Item was changed:
  ----- Method: Lexicon>>setToShowSelector:selectCategory: (in category 'selection') -----
  setToShowSelector: selectorString selectCategory: aBoolean
  "Set up the receiver so that it will show the given selector"
  | catName catIndex messageIndex aList |
  catName := aBoolean
  ifTrue:
  [ (aList := currentVocabulary
  categoriesContaining: selectorString
  forClass: targetClass)
  at: 1
  ifAbsent: [ self class allCategoryName ] ]
  ifFalse: [ self class allCategoryName ].
  catIndex := categoryList
  indexOf: catName
  ifAbsent: [ 1 ].
  self categoryListIndex: catIndex.
  messageList
  detect:
+ [ : anItem | (anItem copyUpTo: Character space) asString asSymbol == selectorString ]
- [ : anItem | (anItem upTo: Character space) asString asSymbol == selectorString ]
  ifFound:
  [ : detectedItem | messageIndex := messageList indexOf: detectedItem.
  self messageListIndex: messageIndex ]
  ifNone: [ ^ self ]!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Protocols-pre.62.mcz

Jakob Reschke
Nice. Had the same in my image but apparently forgot to send it in.

<[hidden email]> schrieb am Di., 7. Mai 2019, 12:09:
Patrick Rein uploaded a new version of Protocols to project The Trunk:
http://source.squeak.org/trunk/Protocols-pre.62.mcz

==================== Summary ====================

Name: Protocols-pre.62
Author: pre
Time: 7 May 2019, 12:09:35.44983 pm
UUID: db63a735-b9ea-6442-9048-022830af513e
Ancestors: Protocols-cmm.61

Replaces calls to the deprecated #upTo: with #copyUpTo: in the lexicon browser

=============== Diff against Protocols-cmm.61 ===============

Item was changed:
  ----- Method: Lexicon>>displaySelector: (in category 'basic operation') -----
  displaySelector: aSelector
        "Set aSelector to be the one whose source shows in the browser.  If there is a category list, make it highlight a suitable category"

        | detectedItem messageIndex |
        self chooseCategory: (self categoryDefiningSelector: aSelector).
        detectedItem := messageList detect:
+               [:anItem | (anItem asString copyUpTo: Character space) asSymbol == aSelector] ifNone: [^ Beeper beep].
-               [:anItem | (anItem asString upTo: $ ) asSymbol == aSelector] ifNone: [^ Beeper beep].
        messageIndex := messageList indexOf: detectedItem.
        self messageListIndex: messageIndex!

Item was changed:
  ----- Method: Lexicon>>selectSelectorItsNaturalCategory: (in category 'selection') -----
  selectSelectorItsNaturalCategory: aSelector
        "Make aSelector be the current selection of the receiver, with the category being its home category."

        | cat catIndex detectedItem |
        cat := self categoryOfSelector: aSelector.
        catIndex := categoryList indexOf: cat ifAbsent:
                ["The method's own category is not seen in this browser; the method probably occurs in some other category not known directly to the class, but for now, we'll just use the all category"
                1].
        self categoryListIndex: catIndex.
        detectedItem := messageList detect:
+               [:anItem | (anItem asString copyUpTo: Character space) asSymbol == aSelector] ifNone: [^ self].
-               [:anItem | (anItem asString upTo: $ ) asSymbol == aSelector] ifNone: [^ self].
        self messageListIndex:  (messageList indexOf: detectedItem ifAbsent: [^ self])!

Item was changed:
  ----- Method: Lexicon>>selectWithinCurrentCategory: (in category 'selection') -----
  selectWithinCurrentCategory: aSelector
        "If aSelector is one of the selectors seen in the current category, select it"

        | detectedItem |
        detectedItem := self messageList detect:
+               [:anItem | (anItem asString copyUpTo: Character space) asSymbol == aSelector] ifNone: [^ self].
-               [:anItem | (anItem asString upTo: $ ) asSymbol == aSelector] ifNone: [^ self].
        self messageListIndex:  (messageList indexOf: detectedItem ifAbsent: [^ self])!

Item was changed:
  ----- Method: Lexicon>>selectorsSendingSelectedSelector (in category 'senders') -----
  selectorsSendingSelectedSelector
        "Assumes lastSendersSearchSelector is already set"
        | selectorSet |
+       autoSelectString := (self lastSendersSearchSelector copyUpTo: $:) asString.
-       autoSelectString := (self lastSendersSearchSelector upTo: $:) asString.
        selectorSet := Set new.
        (self systemNavigation allCallsOn: self lastSendersSearchSelector)
                do: [:anItem | | sel cl |
                        sel := anItem methodSymbol.
                        cl := anItem actualClass.
                        ((currentVocabulary
                                                includesSelector: sel
                                                forInstance: self targetObject
                                                ofClass: targetClass
                                                limitClass: limitClass)
                                        and: [targetClass includesBehavior: cl])
                                ifTrue: [selectorSet add: sel]].
        ^ selectorSet sorted!

Item was changed:
  ----- Method: Lexicon>>setToShowSelector:selectCategory: (in category 'selection') -----
  setToShowSelector: selectorString selectCategory: aBoolean
        "Set up the receiver so that it will show the given selector"
        | catName catIndex messageIndex aList |
        catName := aBoolean
                ifTrue:
                        [ (aList := currentVocabulary
                                categoriesContaining: selectorString
                                forClass: targetClass)
                                at: 1
                                ifAbsent: [ self class allCategoryName ] ]
                ifFalse: [ self class allCategoryName ].
        catIndex := categoryList
                indexOf: catName
                ifAbsent: [ 1 ].
        self categoryListIndex: catIndex.
        messageList
                detect:
+                       [ : anItem | (anItem copyUpTo: Character space) asString asSymbol == selectorString ]
-                       [ : anItem | (anItem upTo: Character space) asString asSymbol == selectorString ]
                ifFound:
                        [ : detectedItem | messageIndex := messageList indexOf: detectedItem.
                        self messageListIndex: messageIndex ]
                ifNone: [ ^ self ]!