[squeak-dev] The Trunk: Collections-mt.962.mcz

Levente Uzonyi leves at caesar.elte.hu
Sat Nov 27 08:56:25 UTC 2021


Hi Marcel,

This change adds another (2nd) dependency between Collections and System.
I think it would be better if this method were in another package with 
initialAnswer: being a parameter.

I also think that the methods with similar name of Model in the Kernel 
package do not belong there. They are entirely related to files and not 
the Model itself.
Model's subclasses can override #suggestedFileNameForSave, but that 
abstraction is clearly not sufficient in case of TranscriptStream, hence 
this method. It's also not used at all in Trunk.

I also think there's also a small bug with this method: Model's 
implementation handles the case where the selected filename is nil, and I 
don't see why that cannot happen here but this method assumes it is always 
a string.


Levente

P.S.: I vaguely remember complaining when the first dependency between 
Colllections and System appeared back in 2020 (HtmlReadWriter -> 
RealEstateAgent).

On Thu, 25 Nov 2021, commits at source.squeak.org wrote:

> Marcel Taeumel uploaded a new version of Collections to project The Trunk:
> http://source.squeak.org/trunk/Collections-mt.962.mcz
>
> ==================== Summary ====================
>
> Name: Collections-mt.962
> Author: mt
> Time: 25 November 2021, 11:50:55.017354 am
> UUID: 3826da22-e39d-2a4a-ada1-95f8f67c85fd
> Ancestors: Collections-pre.961
>
> Tools-mt.1075
>
> =============== Diff against Collections-pre.961 ===============
>
> Item was added:
> + ----- Method: TranscriptStream>>saveContents:accessMode: (in category 'model protocol') -----
> + saveContents: stringContents accessMode: accessMode
> + 	"Interactive callback from TextEditor. See commentary in Model class."
> + 
> + 	^ (Project uiManager
> + 		saveFilenameRequest: 'Save text contents in file...'
> + 		initialAnswer: 'Transcript.text')
> + 			ifEmpty: [false]
> + 			ifNotEmpty: [:fileName |
> + 				Model new
> + 					saveContents: stringContents
> + 					onFileNamed: fileName
> + 					accessMode: accessMode].!


More information about the Squeak-dev mailing list