Hello all,
Has the interpretation of immediate arrays, i.e., #(obj1 obj2) changed?
I have loads of code (from ST80) that creates arrays of intervals like,
#((80 to: 90) (60 to: 70))
where what I want is,
(Array with: (80 to: 90) with: (60 to: 70))
but Squeak reads this as,
ampl: #(#(80 #to: 90) #(60 #to: 70))
Am I missing something?
stp
--------
Stephen Travis Pope Ojai, California, USA

http://HeavenEverywhere.comhttp://FASTLabInc.comhttps://vimeo.com/user19434036/videoshttp://heaveneverywhere.com/Reflections
Hi Squeakers!
In the olden days of ParcPlace, we had 2 tools for “pruning” images: a Stripper could be configures to remove unused classes from an image (e.g., Dev tools, PostScript output) while aWhittler identified unused methods in classes that were being kept (like the package-specific method categories in the system classes as well).
In working in both Squeak and Cuis, I’m a bit shocked by the bloat in Squeak (2833 classes vs 678 in Cuis) and wondered if anyone had a script to remove all the Etoys stuff, Nebraska and the various test categories.
It’d be great if there was a procedure to start with a smaller Squeak image (1000 classes or so) and file in the packages that go beyond the basic development environment. This would also make the system much more approachable to new-comers.
stp
--------
Stephen Travis Pope Ojai, California, USA

http://HeavenEverywhere.comhttp://FASTLabInc.comhttps://vimeo.com/user19434036/videoshttp://heaveneverywhere.com/Reflections
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1495.mcz
==================== Summary ====================
Name: Kernel-eem.1495
Author: eem
Time: 3 January 2023, 2:50:20.023806 pm
UUID: 0f67a835-2719-4d8b-87a7-3a387f44349a
Ancestors: Kernel-pre.1494
Print the inst var name after the index in symbolic (bytecode) method printing/exploring. If folks don't like this being the default the code is set up to be easy to turn into a preference. Just let me know.
=============== Diff against Kernel-pre.1494 ===============
Item was changed:
----- Method: InstructionPrinter>>popIntoReceiverVariable: (in category 'instruction decoding') -----
popIntoReceiverVariable: offset
+ "Print the Remove Top Of Stack And Store Into Instance Variable bytecode."
- "Print the Remove Top Of Stack And Store Into Instance Variable
- bytecode."
+ self print: 'popIntoRcvr: ' , (self stringForReceiverVariableOffset: offset)!
- self print: 'popIntoRcvr: ' , offset printString!
Item was changed:
----- Method: InstructionPrinter>>pushReceiverVariable: (in category 'instruction decoding') -----
pushReceiverVariable: offset
"Print the Push Contents Of the Receiver's Instance Variable Whose Index
is the argument, offset, On Top Of Stack bytecode."
+ self print: 'pushRcvr: ' , (self stringForReceiverVariableOffset: offset)!
- self print: 'pushRcvr: ' , offset printString!
Item was changed:
----- Method: InstructionPrinter>>storeIntoReceiverVariable: (in category 'instruction decoding') -----
storeIntoReceiverVariable: offset
"Print the Store Top Of Stack Into Instance Variable Of Method bytecode."
+ self print: 'storeIntoRcvr: ' , (self stringForReceiverVariableOffset: offset)!
- self print: 'storeIntoRcvr: ' , offset printString!
Item was added:
+ ----- Method: InstructionPrinter>>stringForReceiverVariableOffset: (in category 'printing') -----
+ stringForReceiverVariableOffset: offset
+ | tmpStream |
+ tmpStream := WriteStream on: (String new: 16).
+ offset printOn: tmpStream.
+ method methodClass ifNotNil:
+ [:class|
+ class isBehavior ifTrue:
+ [(class instVarNameForIndex: offset + 1) ifNotNil:
+ [:instVarName|
+ tmpStream nextPutAll: ' "'; nextPutAll: instVarName; nextPut: $"]]].
+ ^tmpStream contents!
Whilst trying to work out why some TestRunner results vary between x64/linux and ARM64/linux systems (and it's very confusing) I've spotted a really odd symptom for one test.
A 22104 update image I downloaded has a couple of AbstractFont methods referring to the otherwise unused and indeed Undeclared variable ForceNonSubPixelCount. After updating to 22313 those methods are removed and thus the ReleaseTest>>#testUndeclared passes. Yay! The removal was caused by Graphics-nice.536
However, a 22221 update image I downloaded in the Squeak6.0-22101-64bit-202206021410-Linux-ARMv8 build already has the Graphics-nice.536 update included. But rather worryingly it isn't the same as the Graphics-nice.536 in the other image. The immediately obvious difference is that it has no AbstractFont class method changes and thus does not remove the references to ForceNonSubPixelCount, and so the ReleaseTest>>#testUndeclared fails.
Happily it looks like the latest Squeak6.1alpha-22313-64bit.zip has things in place correctly, so whatever problem there was is past. Consider this an alert if you have been updating an older image that it might have grabbed one or more updates that didn't include everything they should.
tim
--
tim Rowledge; tim(a)rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: EOS: Erase Operating System
Hello again,
In reference to my previous query, when did it become fashionable to have method category (protocol) names that signified the package? How does this help in navigating the system?
It’s quite confusing when I go to a system class in the browser and see a list of protocols like this,

Isn't there a field in the method header where we could store this, and still use the simpler standard list of protocols to assist in learning the system? Remember, the first rule of reuse is, “if you can’t find it, you can’t reuse it.”
stp
--------
Stephen Travis Pope Ojai, California, USA

http://HeavenEverywhere.comhttp://FASTLabInc.comhttps://vimeo.com/user19434036/videoshttp://heaveneverywhere.com/Reflections
tim Rowledge uploaded a new version of Sound to project The Trunk:
http://source.squeak.org/trunk/Sound-tpr.93.mcz
==================== Summary ====================
Name: Sound-tpr.93
Author: tpr
Time: 2 January 2023, 4:38:20.207407 pm
UUID: 5583f070-14de-4807-b445-c125ad072e9d
Ancestors: Sound-eem.92
When writing a sound out to a file we need to divide the 'remaining' value by //2 to make the file size correct - otherwise it gets padded out by a lot of 0s
=============== Diff against Sound-eem.92 ===============
Item was changed:
----- Method: AbstractSound>>storeSampleCount:bigEndian:on: (in category 'file i/o') -----
storeSampleCount: samplesToStore bigEndian: bigEndianFlag on: aBinaryStream
"Store my samples on the given stream at the current SoundPlayer sampling rate. If bigFlag is true, then each 16-bit sample is stored most-significant byte first (AIFF files), otherwise it is stored least-significant byte first (WAV files). If self isStereo is true, both channels are stored, creating a stereo file. Otherwise, only the left channel is stored, creating a mono file."
| bufSize stereoBuffer reverseBytes streamDirect |
self reset.
bufSize := (2 * self samplingRate rounded) min: samplesToStore. "two second buffer"
stereoBuffer := SoundBuffer newStereoSampleCount: bufSize.
streamDirect := aBinaryStream isKindOf: StandardFileStream.
reverseBytes := (bigEndianFlag xor: Smalltalk isBigEndian) xor: streamDirect not.
'Storing audio...'
displayProgressFrom: 0 to: samplesToStore during: [:bar | | remaining out |
remaining := samplesToStore.
[remaining > 0] whileTrue: [
bar value: samplesToStore - remaining.
stereoBuffer primFill: 0. "clear the buffer"
self playSampleCount: (bufSize min: remaining) into: stereoBuffer startingAt: 1.
out := self isStereo
ifTrue: [stereoBuffer]
ifFalse: [stereoBuffer extractLeftChannel].
reverseBytes ifTrue: [out reverseEndianness].
streamDirect
ifTrue: "optimization for files: write sound buffer directly to file"
+ [aBinaryStream next: (out size // 2 min: remaining// 2) putAll: out startingAt: 1] "size in words"
- [aBinaryStream next: (out size // 2 min: remaining) putAll: out startingAt: 1] "size in words"
ifFalse: "for non-file streams:"
[1 to: (out monoSampleCount min: remaining) do: [:i | aBinaryStream int16: (out at: i)]].
remaining := remaining - bufSize]].!
A new version of Collections was added to project The Inbox:
http://source.squeak.org/inbox/Collections-pre.1027.mcz
==================== Summary ====================
Name: Collections-pre.1027
Author: pre
Time: 2 January 2023, 1:32:23.607278 pm
UUID: 3c8f701b-fa5a-a142-9b00-0520960f1420
Ancestors: Collections-ct.1026
Fixes an issue with LimitedWriteStream>>#nextPutAll: which results in the stream ignoring its write limit.
This removes the duplicate logic for adding the incoming elements to the stream collection. The new version only puts as many elements as would fit into the collection or, if all of the incoming collection fits, uses the super method.
Complements CollectionTests pre.384.
=============== Diff against Collections-ct.1026 ===============
Item was changed:
----- Method: LimitedWriteStream>>nextPutAll: (in category 'writing') -----
nextPutAll: aCollection
| newEnd |
- collection class == aCollection class ifFalse:
- [^ super nextPutAll: aCollection ].
-
newEnd := position + aCollection size.
+ newEnd > limit
+ ifTrue: [
+ super nextPutAll: (aCollection copyFrom: 1 to: (limit - position max: 0)).
+ limitBlock value.
+ ^aCollection]
+ ifFalse: [^ super nextPutAll: aCollection]!
- newEnd > limit ifTrue: [
- super nextPutAll: (aCollection copyFrom: 1 to: (limit - position max: 0)).
- limitBlock value.
- ^aCollection
- ].
- newEnd > writeLimit ifTrue: [
- self growTo: newEnd
- ].
-
- collection replaceFrom: position+1 to: newEnd with: aCollection startingAt: 1.
- position := newEnd.
- ^aCollection!