Christoph Thiede uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ct.1522.mcz
==================== Summary ====================
Name: Kernel-ct.1522
Author: ct
Time: 17 August 2023, 1:50:03.497905 pm
UUID: abf58cc7-53ac-5042-9c7e-861cbfb5e6dd
Ancestors: Kernel-ct.1521
Merges sanitize-cat-names.1.cs (step 2/2):
Sanitizes names of categories and packages by removing leading/trailing blanks before construction/lookup. This fixes a bug with invisible categories in the tree browser.
Answer new package from PackageOrganizer>>#registerPackage*. Recategorize PackageServices.
Must be loaded after Kernel-ct.1521 (step 1/2).
=============== Diff against Kernel-ct.1521 ===============
Item was changed:
----- Method: Categorizer>>addCategory:before: (in category 'accessing') -----
addCategory: catString before: nextCategory
"Add a new category named heading.
If default category exists and is empty, remove it.
If nextCategory is nil, then add the new one at the end,
otherwise, insert it before nextCategory."
| index newCategory |
+ newCategory := (self sanitizeName: catString) asSymbol.
- newCategory := catString asSymbol.
(categoryArray indexOf: newCategory) > 0
ifTrue: [^self]. "heading already exists, so done"
(self isSpecialCategoryName: newCategory)
ifTrue: [^self inform: 'This category name is system reserved' translated].
index := categoryArray indexOf: nextCategory
ifAbsent: [categoryArray size + 1].
categoryArray := categoryArray
copyReplaceFrom: index
to: index-1
with: (Array with: newCategory).
categoryStops := categoryStops
copyReplaceFrom: index
to: index-1
with: (Array with: (index = 1
ifTrue: [0]
ifFalse: [categoryStops at: index-1])).
"remove empty default category"
(newCategory ~= Default
and: [(self listAtCategoryNamed: Default) isEmpty])
ifTrue: [self removeCategory: Default]!
Item was changed:
----- Method: Categorizer>>classify:under:suppressIfDefault: (in category 'classifying') -----
classify: element under: heading suppressIfDefault: aBoolean
"Store the argument, element, in the category named heading. If aBoolean is true, then invoke special logic such that the classification is NOT done if the new heading is the Default and the element already had a non-Default classification -- useful for filein"
| catName catIndex elemIndex realHeading |
realHeading := (heading isEmptyOrNil or: [self isSpecialCategoryName: heading])
ifTrue: [Default]
+ ifFalse: [(self sanitizeName: heading) asSymbol].
- ifFalse: [heading asSymbol].
(catName := self categoryOfElement: element) = realHeading
ifTrue: [^ self]. "done if already under that category"
catName ifNotNil: [
(aBoolean and: [realHeading = Default])
ifTrue: [^ self]. "return if non-Default category already assigned in memory"
self basicRemoveElement: element]. "remove if in another category"
(categoryArray indexOf: realHeading) = 0 ifTrue: [self addCategory: realHeading].
catIndex := categoryArray indexOf: realHeading.
elemIndex :=
catIndex > 1
ifTrue: [categoryStops at: catIndex - 1]
ifFalse: [0].
[(elemIndex := elemIndex + 1) <= (categoryStops at: catIndex)
and: [element >= (elementArray at: elemIndex)]] whileTrue.
"elemIndex is now the index for inserting the element. Do the insertion before it."
elementArray := elementArray copyReplaceFrom: elemIndex to: elemIndex-1
with: (Array with: element).
"add one to stops for this and later categories"
catIndex to: categoryArray size do:
[:i | categoryStops at: i put: (categoryStops at: i) + 1].
((categoryArray includes: Default)
and: [(self listAtCategoryNamed: Default) size = 0]) ifTrue: [self removeCategory: Default].
self assertInvariant.!
Item was changed:
----- Method: Categorizer>>listAtCategoryNamed: (in category 'accessing') -----
listAtCategoryNamed: categoryName
"Answer the array of elements associated with the name, categoryName."
| i |
+ i := categoryArray indexOf: (self sanitizeName: categoryName) ifAbsent: [^Array new].
- i := categoryArray indexOf: categoryName ifAbsent: [^Array new].
^self listAtCategoryNumber: i!
Item was changed:
----- Method: Categorizer>>removeCategory: (in category 'accessing') -----
removeCategory: cat
"Remove the category named, cat. Create an error notificiation if the
category has any elements in it."
| index lastStop |
+ index := categoryArray indexOf: (self sanitizeName: cat) ifAbsent: [^self].
- index := categoryArray indexOf: cat ifAbsent: [^self].
lastStop :=
index = 1
ifTrue: [0]
ifFalse: [categoryStops at: index - 1].
(categoryStops at: index) - lastStop > 0
ifTrue: [^self error: 'cannot remove non-empty category'].
categoryArray := categoryArray copyReplaceFrom: index to: index with: Array new.
categoryStops := categoryStops copyReplaceFrom: index to: index with: Array new.
categoryArray size = 0
ifTrue:
[categoryArray := Array with: Default.
categoryStops := Array with: 0]
!
Item was changed:
----- Method: Categorizer>>renameCategory:toBe: (in category 'accessing') -----
renameCategory: oldCatString toBe: newCatString
"Rename a category. No action if new name already exists, or if old name does not exist."
| index oldCategory newCategory |
+ oldCategory := (self sanitizeName: oldCatString) asSymbol.
+ newCategory := (self sanitizeName: newCatString) asSymbol.
- oldCategory := oldCatString asSymbol.
- newCategory := newCatString asSymbol.
(categoryArray indexOf: newCategory) > 0
ifTrue: [^ self]. "new name exists, so no action"
(index := categoryArray indexOf: oldCategory) = 0
ifTrue: [^ self]. "old name not found, so no action"
categoryArray := categoryArray copy. "need to change identity so smart list update will notice the change"
categoryArray at: index put: newCategory!
Item was changed:
----- Method: ClassOrganizer>>addCategory:before: (in category 'accessing') -----
addCategory: catString before: nextCategory
SystemChangeNotifier uniqueInstance
doSilently: [super addCategory: catString before: nextCategory];
+ protocolAdded: (self sanitizeName: catString) inClass: self subject!
- protocolAdded: catString inClass: self subject!
Item was changed:
----- Method: ClassOrganizer>>removeCategory: (in category 'accessing') -----
removeCategory: cat
SystemChangeNotifier uniqueInstance
doSilently: [super removeCategory: cat];
+ protocolRemoved: (self sanitizeName: cat) inClass: self subject!
- protocolRemoved: cat inClass: self subject!
Item was changed:
----- Method: ClassOrganizer>>renameCategory:toBe: (in category 'accessing') -----
renameCategory: oldCatString toBe: newCatString
SystemChangeNotifier uniqueInstance
doSilently: [super renameCategory: oldCatString toBe: newCatString];
+ protocolRenamedFrom: (self sanitizeName: oldCatString) asSymbol to: (self sanitizeName: newCatString) asSymbol inClass: self subject.
+ self logSelectorsInChangedCategory: (self sanitizeName: newCatString).
- protocolRenamedFrom: oldCatString asSymbol to: newCatString asSymbol inClass: self subject.
- self logSelectorsInChangedCategory: newCatString.
!
Christoph Thiede uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ct.1521.mcz
==================== Summary ====================
Name: Kernel-ct.1521
Author: ct
Time: 17 August 2023, 1:45:58.465905 pm
UUID: fdd3f626-12b1-f347-97c2-80f0d046141c
Ancestors: Kernel-ct.1520
Merges sanitize-cat-names.1.cs (step 1/2):
Sanitizes names of categories and packages by removing leading/trailing blanks before construction/lookup. This fixes a bug with invisible categories in the tree browser.
Answer new package from PackageOrganizer>>#registerPackage*. Recategorize PackageServices.
=============== Diff against Kernel-ct.1520 ===============
Item was added:
+ ----- Method: Categorizer>>sanitizeName: (in category 'private') -----
+ sanitizeName: aString
+
+ ^ aString withBlanksTrimmed!
Christoph Thiede uploaded a new version of Help-Squeak-Project to project The Trunk:
http://source.squeak.org/trunk/Help-Squeak-Project-ct.99.mcz
==================== Summary ====================
Name: Help-Squeak-Project-ct.99
Author: ct
Time: 17 August 2023, 9:12:26.757459 am
UUID: 3c1432d5-67db-0a4a-939f-358fb258fa39
Ancestors: Help-Squeak-Project-ct.98
Removes a font size slip in the front page of the help browser. How come we have not been seeing this for two years?
=============== Diff against Help-Squeak-Project-ct.98 ===============
Item was changed:
----- Method: SqueakHelp class>>introduction (in category 'pages') -----
introduction
"This method was automatically generated. Edit it using:"
"SqueakHelp edit: #introduction"
<generated>
^(HelpTopic
title: 'Welcome'
contents:
'Welcome to Squeak
Visit https://www.squeak.org for the lastest information.
Squeak is a modern, open-source Smalltalk programming system with fast execution environments for all major platforms. It features the Morphic framework, which promotes low effort graphical, interactive application development and maintenance. Many projects have been successfully created with Squeak. They cover a wide range of domains such as education, multimedia, gaming, research, and commerce. Squeak is fast, flexible and free.
It''s Smalltalk!!!!
Everything is an object. Objects collaborate by sending messages to achieve the desired application behavior. The Smalltalk programming language has a concise syntax and simple execution semantics. The Smalltalk system is implemented in itself: Compiler, debugger, programming tools, and so on are all Smalltalk code the user can read and modify. Novice programmers can get started easily and experts can engineer elegant solutions at large.
Morphic UI Framework
All graphical objects are tangible and interactively changeable. This promotes short feedback loops and low-effort application development. Morphic thus leverages the live programming experience of traditional Smalltalk environments from a mainly text-focused domain to a graphical one.
Powerful Tooling
The dynamic Squeak environment provides a variety of tools for browsing, writing, executing, and versioning Smalltalk code. Multiple debugging sessions can be served concurrently. Thanks to Morphic, tool customization can be achieved with reasonable effort.
Fast Virtual Machine
The standard VM for Squeak, Cog Spur, has the most advanced object representation yet devised for Smalltalk. Spur has direct pointers, a compact object header, and efficiently implements become (Smalltalk''s object mutation primitive) via lazy forwarding. Spur provides pinning, and a segmented heap, releasing memory back to the OS after global garbage collection. Cog Spur''s JIT combines context-to-stack mapping, aggressive in-line message caching, a register based calling convention, and Spur''s object representation to provide the fastest production Smalltalk VM. Cog Spur is developed in Smalltalk, in a uniquely productive VM development environment. There are other important Squeak VMs. Examples include SqueakJS, which runs in web browsers, and research VMs such as TruffleSqueak (based on GraalVM and a method JIT using partial evaluation) and RSqueak/VM (based on PyPy''s meta-tracing JIT).
Web Development
With frameworks like Seaside and AIDA, Squeak can be a web server. It provides a layered set of abstractions over HTTP and HTML that let you build highly interactive web applications quickly, reusably, and maintainably.
Multi-Platform Support
Squeak supports Windows, Linux (X86, X64 and ARM), and macOS and is preinstalled on C.H.I.P., Raspberry Pi, and OLPC XO.!!
+ ]style[(19 5 1 22 29 438 15 18 6 33 8 87 14 80 8 2 8 2 17 161 20 27 8 254 16 64 8 11 9 6 10 152 20 29 8 353 24 13 23 43 28 111 26 28 10 19 8 56 13 11 7 48 10 11 6 21 15 22 7 5 4 18 3 163 22 121)a0b,a0,a0b,Rhttps://www.squeak.org;,a0,,i,,Rcode://Object;,,Rcode://MessageSend;,,Rcode://HelpBrowser openOn: TerseGuideHelp;,,Rcode://Compiler;,,Rcode://Debugger;,,Rcode://Browser;,,i,,Rcode://Morph new openInHand;,,i,,Rcode://ToolSet browse: String selector: #findTokens:;,,Rcode://7/0;,,Rcode://MCWorkingCopyBrowser new show;,,i,,Rhttps://github.com/OpenSmalltalk/opensmalltalk-vm#readme;,,Rhttp…
/#virtual-machines;,,Rhttps://squeak.js.org;,,Rhttps://github.com/hpi-swa/trufflesqueak/;,,Rhttps://www.graalvm.org/;,,Rhttps://github.com/hpi-swa/RSqueak/;,,Rhttps://www.pypy.org/;,,i,,Rhttp://www.seaside.st/;,,Rhttp://www.aidaweb.si/;,,Rcode://WebClient;,,i,!!' readStream nextChunkText)
- ]style[(19 5 1 22 29 438 15 18 6 33 8 87 14 80 8 2 8 2 17 161 20 27 8 254 16 64 8 11 9 6 10 152 20 28 1 8 2 351 24 13 23 43 28 111 26 28 10 19 8 56 13 11 7 48 10 11 6 21 15 22 7 5 4 18 3 163 22 121)a0b,a0,a0b,Rhttps://www.squeak.org;,a0,,i,,Rcode://Object;,,Rcode://MessageSend;,,Rcode://HelpBrowser openOn: TerseGuideHelp;,,Rcode://Compiler;,,Rcode://Debugger;,,Rcode://Browser;,,i,,Rcode://Morph new openInHand;,,i,,Rcode://ToolSet browse: String selector: #findTokens:;,,Rcode://7/0;,,Rcode://MCWorkingCopyBrowser new show;,,i,,f5,Rhttps://github.com/OpenSmalltalk/opensmalltalk-vm#readme;,f5,…evelopment/#virtual-machines;,,Rhttps://squeak.js.org;,,Rhttps://github.com…,!!' readStream nextChunkText)
key: #introduction;
shouldStyle: false;
yourself!
Christoph Thiede uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-ct.1032.mcz
==================== Summary ====================
Name: Tools-ct.1032
Author: ct
Time: 10 March 2021, 6:51:33.356304 pm
UUID: 897e4ea2-3740-6a45-a054-d7da65105568
Ancestors: Tools-mt.1030
In the Message Names tool, show definition, comment, and hierarchy for class hits. In particular helpful to find out efficiently whether a selector belongs to a binding or to an actual class.
=============== Diff against Tools-mt.1030 ===============
Item was changed:
----- Method: MessageNames>>computeMessageList (in category 'search') -----
computeMessageList
+ | selector |
+ selectorListIndex = 0 ifTrue: [^ #()].
+
+ selector := selectorList at: selectorListIndex.
+ ^ (selector first isUppercase ifTrue: [Smalltalk classNamed: selector])
+ ifNotNil: [:class |
+ class := Smalltalk classNamed: selector.
+ #(Definition Comment Hierarchy) collect: [:sel |
+ MethodReference class: class selector: sel] ]
+ ifNil: [self systemNavigation allImplementorsOf: selector]!
- ^ selectorListIndex = 0
- ifTrue: [#()]
- ifFalse: [self systemNavigation
- allImplementorsOf: (selectorList at: selectorListIndex)]!
Item was changed:
----- Method: MessageNames>>selectedMessageName (in category 'message list') -----
selectedMessageName
selectorList basicSize = 0 ifTrue: [^ nil]. "Deals with selectorList nil or empty"
+ ^super selectedMessageName ifNil: [
+ "only message name selected"
+ selectorList at: (selectorListIndex max: 1) ifAbsent: [nil] "If no selection we can still find a selector"]!
- ^selectorList at: (selectorListIndex max: 1) ifAbsent: [nil] "If no selection we can still find a selector"!
Item was changed:
----- Method: MessageSet>>aboutToStyle: (in category 'code pane') -----
+ aboutToStyle: aStyler
+ "This is a notification that aStyler is about to re-style its text.
+ Set the classOrMetaClass in aStyler, so that identifiers will be resolved correctly.
- aboutToStyle: aPluggableShoutMorphOrView
- "This is a notification that aPluggableShoutMorphOrView is about to re-style its text.
- Set the classOrMetaClass in aPluggableShoutMorphOrView, so that identifiers
- will be resolved correctly.
Answer true to allow styling to proceed, or false to veto the styling"
| selectedMessageName showingMethod |
self showingSource ifFalse: [^false].
selectedMessageName := self selectedMessageName.
showingMethod := (#(Comment Definition Hierarchy) includes: selectedMessageName) not.
+ aStyler parseAMethod: showingMethod.
"Hack!! setting classOrMetaClass: to nil allows doit or class definition colouring."
+ aStyler classOrMetaClass: (showingMethod ifTrue: [self selectedClassOrMetaClass]).
- aPluggableShoutMorphOrView classOrMetaClass: (showingMethod ifTrue: [self selectedClassOrMetaClass]).
^(#(Comment Hierarchy) includes: selectedMessageName) not!
Item was changed:
----- Method: MessageSet>>selectedMessage (in category 'message list') -----
selectedMessage
"Answer the source method for the currently selected message."
-
self setClassAndSelectorIn: [:class :selector | | source |
class ifNil: [^ 'Class vanished'].
selector first isUppercase ifTrue:
[selector == #Comment ifTrue:
+ ["currentCompiledMethod := class organization commentRemoteStr."
- [currentCompiledMethod := class organization commentRemoteStr.
^ class comment].
selector == #Definition ifTrue:
[^ class definition].
selector == #Hierarchy ifTrue: [^ class printHierarchy]].
source := class sourceMethodAt: selector ifAbsent:
[currentCompiledMethod := nil.
^ 'Missing'].
self showingDecompile ifTrue: [^ self decompiledSourceIntoContents].
currentCompiledMethod := class compiledMethodAt: selector ifAbsent: [nil].
self showingDocumentation ifTrue: [^ self commentContents].
source := self sourceStringPrettifiedAndDiffed.
^ source asText makeSelectorBoldIn: class]!
Christoph Thiede uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ct.1520.mcz
==================== Summary ====================
Name: Kernel-ct.1520
Author: ct
Time: 15 August 2023, 3:10:09.691866 pm
UUID: 26ff8963-9b5d-8a49-b54a-35a487efc001
Ancestors: Kernel-mt.1519
Proposal: Adds ScaledDecimal>>#printFractionAsDecimal similar to #printShowingDecimalPlaces:.
Usage:
(5/7*100s2) printFractionAsDecimal '71.42'
Essentially, this gets rid of the scale ("s2") to create a user-friendly printString.
=============== Diff against Kernel-mt.1519 ===============
Item was added:
+ ----- Method: ScaledDecimal>>printFractionAsDecimal (in category 'printing') -----
+ printFractionAsDecimal
+
+ ^ String streamContents: [:stream |
+ self printFractionAsDecimalOn: stream]!