Is String withUnixLineEnding mutation behavior a bug?

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

Is String withUnixLineEnding mutation behavior a bug?

Ronie Salgado
Hi,

I just noticed that String >> withUnixLineEndings modifies the the original string, at least when the string only has cr, and not crlf. For example, try the following (in Pharo 7) in a Playground:

original :='asa' , String cr , 'asa'.
newString := original withUnixLineEndings.
original at: 4.

Best regards,
Ronie
Reply | Threaded
Open this post in threaded view
|

Re: Is String withUnixLineEnding mutation behavior a bug?

tinchodias
Hi.
In Pharo 1.4 wasn't like that.
I evaluated your script and last sentence answers Character cr.

The selector doesn't indicate a mutation IMO.

Martín

El lun., 18 de mar. de 2019 a la(s) 15:20, Ronie Salgado
([hidden email]) escribió:

>
> Hi,
>
> I just noticed that String >> withUnixLineEndings modifies the the original string, at least when the string only has cr, and not crlf. For example, try the following (in Pharo 7) in a Playground:
>
> original :='asa' , String cr , 'asa'.
> newString := original withUnixLineEndings.
> original at: 4.
>
> Best regards,
> Ronie