[prev in list] [next in list] [prev in thread] [next in thread]
List: squeak-dev
Subject: [squeak-dev] Re: The Trunk: System-cmm.1447.mcz
From: Eliot Miranda <eliot.miranda () gmail ! com>
Date: 2024-02-26 15:49:49
Message-ID: 80E42452-49A3-4F64-980C-01B1A4E7790E () gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
[Attachment #4 (text/html)]
<html><head><meta http-equiv="content-type" content="text/html; \
charset=utf-8"></head><body dir="auto"><div dir="ltr"><br></div><div \
dir="ltr"><br><blockquote type="cite">On Feb 24, 2024, at 1:28 PM, Chris Muller \
<asqueaker@gmail.com> wrote:<br><br></blockquote></div><blockquote \
type="cite"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi \
Levente,<div><br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">My understanding is that all platforms support \
these streams, not just <br> \
Linux.<br></blockquote><div><br></div><div>Agreed.</div><div> </div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"> FileStream's #stdout and #stderr are special \
streams (see #newForStdio) <br> whose lineEndConvention is set according to the \
platform's default, <br> which means that #cr sent to these streams produces the \
platform's new <br> line character on the stream[1].<br>
So, changing #cr to #lf in those methods does nothing but breaks line <br>
endings on non-unix platforms (Windows and older \
Macs).<br></blockquote><div><br></div><div>My understanding is that, regardless \
whether you write #lf, #cr, or #crlf, if MultiByteFileStream's \
#wantsLineEndConversion is true, it will write out whatever the correct line-ending \
for the running platform. I only changed the code for "semantics" when \
reading the code based on the historical origin of \
"stdout".</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px \
0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">[1] \
#newForStdio forces #lf even if the platform's line-end convention <br> is #cr. That \
should probably be changed as <br> #guessDefaultLineEndConvention does a good job \
determining the correct <br> value.<br></blockquote><div><br></div><div>I'm not sure \
about that. I think #wantsLineEndConversion: true is all that's \
needed.</div><div><br></div><div>I don't have any Windows machines handy. If \
I'm wrong, I will certainly undo \
this.</div></div></div></div></blockquote><div><br></div>Please do! The stdio \
facility is intended for all platforms.<div><br><blockquote type="cite"><div \
dir="ltr"><div dir="ltr"><div \
class="gmail_quote"><div><br></div><div>Best,</div><div> \
Chris</div><div><br></div><div> </div><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"> <br>
On 2024. 02. 19. 0:05, <a href="mailto:commits@source.squeak.org" \
target="_blank">commits@source.squeak.org</a> wrote:<br> > Chris Muller uploaded a \
new version of System to project The Trunk:<br> > <a \
href="http://source.squeak.org/trunk/System-cmm.1447.mcz" rel="noreferrer" \
target="_blank">http://source.squeak.org/trunk/System-cmm.1447.mcz</a><br> > <br>
> ==================== Summary ====================<br>
> <br>
> Name: System-cmm.1447<br>
> Author: cmm<br>
> Time: 12 February 2024, 3:06:16.671515 pm<br>
> UUID: 03b7d234-da01-4b78-94c0-f78c01d4afe0<br>
> Ancestors: System-codefrau.1446<br>
> <br>
> FileStream's stdout and stderr are for Linux, so use Linux line-endings when \
writing to them.<br> > <br>
> =============== Diff against System-codefrau.1446 ===============<br>
> <br>
> Item was changed:<br>
> ----- Method: CodeLoader>>installSourceFile: (in category \
'installing') -----<br> > installSourceFile: aStream<br>
> "Install the previously loaded source file"<br>
> | contents trusted |<br>
> aStream ifNil:[^self error:'No content to \
install'].<br> > trusted := SecurityManager default \
positionToSecureContentsOf: aStream.<br> > trusted \
ifFalse:[(SecurityManager default enterRestrictedMode)<br> > \
\
ifFalse:[ aStream close.<br> > \
\
\
^ self error:'Insecure content encountered']].<br> > \
contents := self allButShebangLine: aStream upToEnd unzipped \
asString.<br> > (aStream respondsTo: #close) \
ifTrue:[aStream close].<br> > ^[contents readStream \
fileIn]<br> > on: \
SyntaxErrorNotification<br> > \
do: [ : err | Smalltalk isHeadless<br> > \
ifTrue:<br> > + \
\
[FileStream stdout nextPutAll: err errorCode; lf; flush.<br> > - \
\
[FileStream stdout nextPutAll: err errorCode; cr; flush.<br> > \
\
Smalltalk snapshot: false andQuit: true ]<br> > \
ifFalse: [err \
pass] ]!<br> > <br>
> Item was changed:<br>
> ----- Method: Exception>>printVerboseOn: (in category \
'*system') -----<br> > printVerboseOn: aStream<br>
> aStream<br>
> nextPutAll: \
'vvvvvvvvvvvvvvvvvv ' , self description , ' vvvvvvvvvvvvvvvvvv' ;<br> > + \
lf ;<br> > - \
cr ;<br> > \
nextPutAll: 'The time is ', DateAndTime now asString ;<br> > + \
lf.<br> > - \
cr.<br> > "Allow applications to optionally \
print extra details without overriding a base package."<br> > \
self printDetailsOn: aStream.<br> > aStream<br>
> nextPutAll: self \
signalerContext longStack ;<br> > + \
lf ;<br> > - cr ;<br>
> nextPutAll: \
'^^^^^^^^^^^^^^^^^^ ' , self description , ' ^^^^^^^^^^^^^^^^^^' ;<br> > + \
lf ;<br> > - \
cr ;<br> > \
flush!<br> > <br>
> Item was changed:<br>
> ----- Method: SmalltalkImage>>run: (in category 'command \
line') -----<br> > run: aBlock<br>
> [ [ self patchSystem.<br>
> (aBlock numArgs = 1 and: [ self arguments size > 1 \
])<br> > ifTrue: [ "Allow a \
large, variable number of arguments to be passed as an Array to aBlock."<br> \
> \
aBlock value: self arguments ]<br> > \
ifFalse: [ aBlock valueWithEnoughArguments: self arguments ] \
]<br> > on: \
SyntaxErrorNotification<br> > \
do:<br> > \
[ : err | FileStream stdout<br> > \
\
nextPutAll: err errorCode ;<br> > + \
lf; flush.<br> > \
- \
cr; flush.<br> > \
self isHeadless<br> > \
\
ifTrue: [ self snapshot: false andQuit: true ]<br> > \
\
ifFalse: [ err pass ] ]<br> > \
on: Error , ProvideAnswerNotification<br> > \
do:<br> > \
[ : err | err printVerboseOn: \
FileStream stderr.<br> > \
FileStream stderr flush.<br> > \
self isHeadless<br> \
> \
ifTrue: [ self snapshot: false andQuit: true ]<br> \
> \
ifFalse: [ err pass ] ]<br> > \
on: ProgressInitiationException<br> \
> do:<br> > \
[ : pie | "Don't \
want to log this Notification."<br> > \
pie defaultAction ] ]<br> > \
on: Notification , Warning<br> > \
do:<br> > \
[ : noti | FileStream \
stdout<br> > \
nextPutAll: DateAndTime now asString ;<br> \
> \
space ;<br> > \
\
nextPutAll: noti description ;<br> > + \
lf.<br> > - \
\
cr.<br> > \
noti resume ]<br> > !<br>
> <br>
> <br>
<br>
</blockquote></div></div>
<span></span><br></div></blockquote></div></body></html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic