[Pharo-project] CrLfFileStream class>>new?!
I was just puzzled why "CrLfFileStream defaultToLF" does not work until I figured that CrLfFileStream new returns an instance of a different class: CrLfFileStream class>>new ^ (MultiByteFileStream new) wantsLineEndConversion: true; yourself. Does somebody know what the point is? I really sometimes wonder why good coders write such code, and not even care to add a comment... Cheers, Adrian ___________________ http://www.adrian-lienhard.ch/
Den 09.03.2010 14:38, skrev Adrian Lienhard:
I was just puzzled why "CrLfFileStream defaultToLF" does not work until I figured that CrLfFileStream new returns an instance of a different class:
CrLfFileStream class>>new ^ (MultiByteFileStream new) wantsLineEndConversion: true; yourself.
Does somebody know what the point is? I really sometimes wonder why good coders write such code, and not even care to add a comment...
Cheers, Adrian ___________________ http://www.adrian-lienhard.ch/
CrLfFileStream does not handle any encodings other than latin1. My guess is: - MultiByteFileStream probably didn't exist when it was created. - Using a MultiByteFileStream with no encoding, but a lineEndConvention is now the preferred method, but CrLfFileStream was kept for backwards-compatability. Cheers, Henry
It would be good to add that to the method and class comment. Henrik? Stef On Mar 9, 2010, at 3:11 PM, Henrik Johansen wrote:
Den 09.03.2010 14:38, skrev Adrian Lienhard:
I was just puzzled why "CrLfFileStream defaultToLF" does not work until I figured that CrLfFileStream new returns an instance of a different class:
CrLfFileStream class>>new ^ (MultiByteFileStream new) wantsLineEndConversion: true; yourself.
Does somebody know what the point is? I really sometimes wonder why good coders write such code, and not even care to add a comment...
Cheers, Adrian ___________________ http://www.adrian-lienhard.ch/
CrLfFileStream does not handle any encodings other than latin1.
My guess is: - MultiByteFileStream probably didn't exist when it was created. - Using a MultiByteFileStream with no encoding, but a lineEndConvention is now the preferred method, but CrLfFileStream was kept for backwards-compatability.
Cheers, Henry
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
On 09.03.2010 21:48, Stéphane Ducasse wrote:
It would be good to add that to the method and class comment. Henrik?
Stef Slice-CrLfFileStreamDeprecation in Inbox.
Adds an explanation to class comment and in new method, reroutes the default-lineEnd methods, and deprecates basicNew just in case. Cheers, Henry
coooool ! I like to be in this community. Stef On Mar 10, 2010, at 1:06 AM, Henrik Sperre Johansen wrote:
On 09.03.2010 21:48, Stéphane Ducasse wrote:
It would be good to add that to the method and class comment. Henrik?
Stef Slice-CrLfFileStreamDeprecation in Inbox.
Adds an explanation to class comment and in new method, reroutes the default-lineEnd methods, and deprecates basicNew just in case.
Cheers, Henry
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Thanks, Henrik! I created issue http://code.google.com/p/pharo/issues/detail?id=2128 so it doesn't get lost. Cheers, Adrian On Mar 10, 2010, at 01:06 , Henrik Sperre Johansen wrote:
On 09.03.2010 21:48, Stéphane Ducasse wrote:
It would be good to add that to the method and class comment. Henrik?
Stef Slice-CrLfFileStreamDeprecation in Inbox.
Adds an explanation to class comment and in new method, reroutes the default-lineEnd methods, and deprecates basicNew just in case.
Cheers, Henry
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
participants (4)
-
Adrian Lienhard -
Henrik Johansen -
Henrik Sperre Johansen -
Stéphane Ducasse