The Inbox: System-ct.1208.mcz

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

The Inbox: System-ct.1208.mcz

commits-2
Christoph Thiede uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-ct.1208.mcz

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

Name: System-ct.1208
Author: ct
Time: 24 January 2021, 3:46:48.741384 pm
UUID: d2a952ca-fe5d-0045-b089-f8702dbdbb1e
Ancestors: System-eem.1207

Proposal: Adds query & browse selectors for finding certain primitive methods to SystemNavigation. Also excludes quick methods from #allPrimitiveMethods.

Usage:
        self systemNavigation browseAllPrimitiveMethods.
        self systemNavigation allPrimitiveMethodsFor: 38.
        self systemNavigation browseAllPrimitiveMethodsFor: 62.
        self systemNavigation browseAllPrimitiveMethodsFor: 'primitiveFindSubstring'.

=============== Diff against System-eem.1207 ===============

Item was changed:
  ----- Method: SystemNavigation>>allPrimitiveMethods (in category 'query') -----
  allPrimitiveMethods
  "Answer a collection of all the methods that are implemented by primitives."
 
  | result |
  result := OrderedCollection new.
  self allSelectorsAndMethodsDo: [ :behavior :selector :method |
+ (method isQuick not and: [method primitive ~= 0]) ifTrue: [
- method primitive ~= 0 ifTrue: [
  result add: (String streamContents: [ :stream |
  stream
  nextPutAll: behavior name;
  space;
  nextPutAll: selector;
  space;
  print: method primitive ]) ] ].
  ^result!

Item was added:
+ ----- Method: SystemNavigation>>allPrimitiveMethodsFor: (in category 'query') -----
+ allPrimitiveMethodsFor: primitiveIndexOrName
+
+ ^ self allMethodsSelect: [:method | method primitive = primitiveIndexOrName
+ or: [method primitive = 117 and: [ | symbols |
+ symbols := method literalAt: 1.
+ symbols first = primitiveIndexOrName or: [symbols second = primitiveIndexOrName]]]]!

Item was added:
+ ----- Method: SystemNavigation>>browseAllPrimitiveMethods (in category 'browse') -----
+ browseAllPrimitiveMethods
+
+ ^ self
+ browseMessageList: [self allPrimitiveMethods]
+ name: ('Primitive methods' translated)!

Item was added:
+ ----- Method: SystemNavigation>>browseAllPrimitiveMethodsFor: (in category 'browse') -----
+ browseAllPrimitiveMethodsFor: primitiveIndexOrName
+
+ ^ self
+ browseMessageList: [self allPrimitiveMethodsFor: primitiveIndexOrName]
+ name: ('Primitive methods for {1}' translated format: {primitiveIndexOrName})
+ autoSelect: primitiveIndexOrName asString!