[squeak-dev] The Trunk: Multilingual-mt.259.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Mon Nov 29 17:56:36 UTC 2021


Hi Levente --

>Can you should me an example where these backstops actually make a difference?

No, I can't. I was wondering why people would explicitly write MultiByteFileStream in the first place, which is bad style. I figured maybe because of that protocol. Actually, StandardFileStream should support #lineEndConvention (etc.), too. Then we could remove/replace the extension.

This is mere documentation in the Multilingual package that says: 'Trust me, I integrated myself into the system. Just use FileStream and I will come along when needed.' :-) Something like that.

Should I remove it again? Seems wrong. For example, take a look at Workspace >> #saveContents:onFileNamed:accessMode:. There, it reads:

... fileStream lineEndConvention: ...

There is no need to expose the multi-byte nature of the file stream in current systems. Yet, I would not feel comfortable writing that without having #lineEndConvention: present in FileStream.

Does this somehow make sense? Information hiding. Abstraction. That kind of thing. :-)

Best,
Marcel
Am 27.11.2021 09:30:36 schrieb Levente Uzonyi <leves at caesar.elte.hu>:
Hi Marcel,

Can you should me an example where these backstops actually make a
difference?


Levente

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

> Marcel Taeumel uploaded a new version of Multilingual to project The Trunk:
> http://source.squeak.org/trunk/Multilingual-mt.259.mcz
>
> ==================== Summary ====================
>
> Name: Multilingual-mt.259
> Author: mt
> Time: 25 November 2021, 11:28:53.961354 am
> UUID: 6e1246cc-66e2-9140-9e22-49ba1ebad024
> Ancestors: Multilingual-ul.258
>
> Adds some backstops to FileStream to avoid having to name "MultiByteFileStream" explicitely in your code. Just use "FileStream fileNamed:do:" etc. and rely on polymorphism.
>
> =============== Diff against Multilingual-ul.258 ===============
>
> Item was added:
> + ----- Method: FileStream>>detectLineEndConvention (in category '*Multilingual-accessing') -----
> + detectLineEndConvention
> + "Backstop. See MultiByteFileStream."
> +
> + ^ nil!
>
> Item was added:
> + ----- Method: FileStream>>lineEndConvention (in category '*Multilingual-accessing') -----
> + lineEndConvention
> + "See MultiByteFileStream and also String >> #withSqueakLineEndings."
> +
> + ^ #cr!
>
> Item was added:
> + ----- Method: FileStream>>lineEndConvention: (in category '*Multilingual-accessing') -----
> + lineEndConvention: aSymbolOrNil
> + "Ignore here. See MultiByteFileStream."!
>
> Item was added:
> + ----- Method: FileStream>>setConverterForCode (in category '*Multilingual-accessing') -----
> + setConverterForCode
> + "Backstop. See MultiByteFileStream."!
>
> Item was added:
> + ----- Method: FileStream>>wantsLineEndConversion: (in category '*Multilingual-accessing') -----
> + wantsLineEndConversion: aBoolean
> + "Backstop. See MultiByteFileStream."!
>
> Item was changed:
> ----- Method: MultiByteFileStream>>lineEndConvention: (in category 'accessing') -----
> lineEndConvention: aSymbol
> + "#cr, #lf, #crlf"
> +
> -
> (lineEndConvention := aSymbol) ifNotNil: [wantsLineEndConversion := true].
> self installLineEndConventionInConverter!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211129/852ad767/attachment.html>


More information about the Squeak-dev mailing list