Looking at the "Senders" in Finder also returns code that does not contain the message I'm looking for in Pharo?

Opened a new Pharo 5 image, opened Finder, and looked for the + selector. Then select "+" and "Sent." About 5,000 results were obtained, most of them seem to be excellent, but upon closer inspection, some of the results do not seem to have any reference to sending my message.

Not all that I could add, about 1700 of them seem erroneous and do not contain links to +, which is never so. What do you think is the problem? Here is one example:

Example

+4
source share
2 answers

Update

, -; , #+ -, , , ( -)

-, Pharo (re) , ; , ,

Something>>loop
    1 to: 10 do: [ :each | ]

, -,

enter image description here

- .


-, , .

enter image description here

, Pharo ( Pharo):

  • #+ senders ,
  • senders ( doubleclick ctrl + n, )
    • sendersallSendersOf:thoroughWhichSelectorsReferTo:

.

thoroughWhichSelectorsReferTo: literal
    "Answer a set of selectors whose methods access the argument as a 
    literal. Dives into the compact literal notation, making it slow but 
    thorough "
    | selectors special byte |
    "for speed we check the special selectors here once per class"
    special := Smalltalk
        hasSpecialSelector: literal
        ifTrueSetByte: [ :value | byte := value ].
    selectors := OrderedCollection new.
    self selectorsAndMethodsDo: [ :sel :method |
            ((method refersToLiteral: literal) or: [special and: [method scanFor: byte]]) ifTrue: [selectors add: sel]].
    ^ selectors
+6

, @Peter :

  1 to: 10 do: [:each | dictionary at: each put: each]

+ 1 each , .

+ 1 , . , , , Smalltalk , CompiledMethod, , , , -.

,

m
  1 to: 10 do: [:i | i foo]

, Ir tab :

 1. label: 1
 2. pushLiteral: 1
 3. popIntoTemp: #i
 4. goto: 2

 5. label: 2
 6. pushTemp: #i
 7. pushLiteral: 10
 8. send: #'<='
 9. if: false goto: 4 else: 3

10. label: 3
11. pushTemp: #i
12. send: #foo
13. popTop
14. pushTemp: #i
15. pushLiteral: 1
16. send: #+                       "Here we sum 1 to i"
17. popIntoTemp: #i
18. goto: 2

19. label: 4
20. returnReceiver

15 16 + 1. , #+ ( Raw ). AST, +


?

, #to:do: , , . - , .

,

self foo.
1 to: 10 do: [:i | i foo].
self bar

4 : foo, to:do:, foo () bar. 3 foo, foo bar - to:do: .

, to:do: 1 block i, send +, ( ).

,

m
  | block |
  block := [:i | i foo].
  self foo.
  1 to: 10 do: block
  self bar

inline to:do: . +.


: do: , ?

. , to:do: , . , to:do:?

, , #to:do: . , to:do:. , to:do: , - . , "" to:do:, , "" .

+4

Source: https://habr.com/ru/post/1667451/


All Articles