<div dir="ltr">Sorry Christoph, I'm not a fan of this one.  IMO, such an abstraction isn't worth  poaching such a common word, #article, from availability for applications and expanding Squeak's core API with it, especially for something of such limited use.  Many objects already care enough to provide their own #printOn: anyway (sometimes not even calling super).  There's no multilingual hook here (not that there should be one, for this I think there shouldn't) since, even if it *was* possible to replace regular Strings with one's own subclass, that isn't how one would handle internationalization in Squeak.<div><br></div><div>Instead of adding code to increase printing of type information, the abstraction *I* like for #printOn: is one that could *exclude* the printing of it entirely, and assures a *terse, one-line*  print (like, < 80 characters) which identifies the object to the user, but excludes unnecessary data details like its "type" (class).  Numbers and Dates and a few others do this by default, but I like this style to be available for all types as an "alternate" #abbreviatedPrintString, depending on the use-case I'm printing it for (e.g., as elements of a Collection).</div><div><br></div><div>Anyway, I call it #printAbbreviatedOn: in my own code, and even though it's been useful to me over two decades and I still use it, I never actually proposed it for trunk because just the one level of intercept, #printOn:, has proven to be *just the right amount* of abstraction for object printing in a general sense.  Simplicity and resilience from original Smalltalk-80 that has withstood the test of time.</div><div><br></div><div>Best,</div><div>  Chris</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 19, 2020 at 4:03 PM Thiede, Christoph <<a href="mailto:Christoph.Thiede@student.hpi.uni-potsdam.de" target="_blank">Christoph.Thiede@student.hpi.uni-potsdam.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div id="gmail-m_4467980370454135486gmail-m_8096829450632059503gmail-m_1590136113932725890gmail-m_-6238714089243233109gmail-m_4227045164420014376gmail-m_687434318586815398gmail-m_-3986382500144549116gmail-m_5912909769806431869gmail-m_-5275981813677785441gmail-m_-3321027873788595679divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<div id="gmail-m_4467980370454135486gmail-m_8096829450632059503gmail-m_1590136113932725890gmail-m_-6238714089243233109gmail-m_4227045164420014376gmail-m_687434318586815398gmail-m_-3986382500144549116gmail-m_5912909769806431869gmail-m_-5275981813677785441gmail-m_-3321027873788595679divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>Hi all, <span style="font-size:12pt">please take a look at the following changeset. It eliminates a lot of duplication for printing a string with article, for example:</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
</div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p><span style="font-size:12pt"></span></p>
<div>| title |</div>
<div>title := self class name.</div>
<div><span style="font-size:12pt">aStream</span><br>
</div>
<div><span style="white-space:pre-wrap"></span>nextPutAll: (title first isVowel ifTrue: ['an '] ifFalse: ['a ']);</div>
<div><span style="white-space:pre-wrap"></span>nextPutAll: title.</div>
<p></p>
</div>
</blockquote>
<div dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div id="gmail-m_4467980370454135486gmail-m_8096829450632059503gmail-m_1590136113932725890gmail-m_-6238714089243233109gmail-m_4227045164420014376gmail-m_687434318586815398gmail-m_-3986382500144549116gmail-m_5912909769806431869gmail-m_-5275981813677785441gmail-m_-3321027873788595679Signature">
<div id="gmail-m_4467980370454135486gmail-m_8096829450632059503gmail-m_1590136113932725890gmail-m_-6238714089243233109gmail-m_4227045164420014376gmail-m_687434318586815398gmail-m_-3986382500144549116gmail-m_5912909769806431869gmail-m_-5275981813677785441gmail-m_-3321027873788595679divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="divtagdefaultwrapper">
<div>
<div id="gmail-m_4467980370454135486gmail-m_8096829450632059503gmail-m_1590136113932725890gmail-m_-6238714089243233109gmail-m_4227045164420014376gmail-m_687434318586815398gmail-m_-3986382500144549116gmail-m_5912909769806431869gmail-m_-5275981813677785441gmail-m_-3321027873788595679Item.MessagePartBody">
<div id="gmail-m_4467980370454135486gmail-m_8096829450632059503gmail-m_1590136113932725890gmail-m_-6238714089243233109gmail-m_4227045164420014376gmail-m_687434318586815398gmail-m_-3986382500144549116gmail-m_5912909769806431869gmail-m_-5275981813677785441gmail-m_-3321027873788595679Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="gmail-m_4467980370454135486gmail-m_8096829450632059503gmail-m_1590136113932725890gmail-m_-6238714089243233109gmail-m_4227045164420014376gmail-m_687434318586815398gmail-m_-3986382500144549116gmail-m_5912909769806431869gmail-m_-5275981813677785441gmail-m_-3321027873788595679divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="gmail-m_4467980370454135486gmail-m_8096829450632059503gmail-m_1590136113932725890gmail-m_-6238714089243233109gmail-m_4227045164420014376gmail-m_687434318586815398gmail-m_-3986382500144549116gmail-m_5912909769806431869gmail-m_-5275981813677785441gmail-m_-3321027873788595679Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont">
<div><font size="3" color="black"><span style="font-size:12pt"><a href="http://www.hpi.de/" rel="noopener noreferrer" id="gmail-m_4467980370454135486gmail-m_8096829450632059503gmail-m_1590136113932725890gmail-m_-6238714089243233109gmail-m_4227045164420014376gmail-m_687434318586815398gmail-m_-3986382500144549116gmail-m_5912909769806431869gmail-m_-5275981813677785441gmail-m_-3321027873788595679LPNoLP" target="_blank"><font size="2"><span id="gmail-m_4467980370454135486gmail-m_8096829450632059503gmail-m_1590136113932725890gmail-m_-6238714089243233109gmail-m_4227045164420014376gmail-m_687434318586815398gmail-m_-3986382500144549116gmail-m_5912909769806431869gmail-m_-5275981813677785441gmail-m_-3321027873788595679LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</font></div>
</div>
</font></div>
</div>
</div>
</div>
<div id="gmail-m_4467980370454135486gmail-m_8096829450632059503gmail-m_1590136113932725890gmail-m_-6238714089243233109gmail-m_4227045164420014376gmail-m_687434318586815398gmail-m_-3986382500144549116gmail-m_5912909769806431869gmail-m_-5275981813677785441gmail-m_-3321027873788595679Item.MessagePartBody"><br>
</div>
<div id="gmail-m_4467980370454135486gmail-m_8096829450632059503gmail-m_1590136113932725890gmail-m_-6238714089243233109gmail-m_4227045164420014376gmail-m_687434318586815398gmail-m_-3986382500144549116gmail-m_5912909769806431869gmail-m_-5275981813677785441gmail-m_-3321027873788595679Item.MessagePartBody">With this changeset, the example is rewritten much simpler as:</div>
<div id="gmail-m_4467980370454135486gmail-m_8096829450632059503gmail-m_1590136113932725890gmail-m_-6238714089243233109gmail-m_4227045164420014376gmail-m_687434318586815398gmail-m_-3986382500144549116gmail-m_5912909769806431869gmail-m_-5275981813677785441gmail-m_-3321027873788595679Item.MessagePartBody"><br>
</div>
</div>
</div>
</div>
</div>
</div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div>
<div dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="divtagdefaultwrapper">
<div>
<div id="gmail-m_4467980370454135486gmail-m_8096829450632059503gmail-m_1590136113932725890gmail-m_-6238714089243233109gmail-m_4227045164420014376gmail-m_687434318586815398gmail-m_-3986382500144549116gmail-m_5912909769806431869gmail-m_-5275981813677785441gmail-m_-3321027873788595679Item.MessagePartBody"><span>aStream nextPutAll: self class name asString withArticle.</span><br>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<font face="Calibri, Arial, Helvetica, sans-serif"><br>
</font>
<div dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div>
<div dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="divtagdefaultwrapper">
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<div><font face="Calibri, Arial, Helvetica, sans-serif">(Additionally, this unification provides a possible hook, should we ever want to increase multilingual support. :))</font></div>
<div><font face="Calibri, Arial, Helvetica, sans-serif"><br>
</font></div>
<div><font face="Calibri, Arial, Helvetica, sans-serif">I tried to find as many occurrences as possible (6), but even if we don't replace them all, I would like to propose to put the following three methods into Trunk (which are part of the changeset, of course):</font></div>
<div><font face="Calibri, Arial, Helvetica, sans-serif"><br>
</font></div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div><font face="Calibri, Arial, Helvetica, sans-serif">String >> article</font></div>
<div><font face="Calibri, Arial, Helvetica, sans-serif">
<div><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;white-space:pre-wrap"></span>^ self first isVowel</div>
</font></div>
<div><font face="Calibri, Arial, Helvetica, sans-serif">
<div><span style="white-space:pre-wrap"></span>ifTrue: ['an']</div>
</font></div>
<div><font face="Calibri, Arial, Helvetica, sans-serif">
<div><span style="white-space:pre-wrap"></span>ifFalse: ['a']</div>
</font></div>
<div><font face="Calibri, Arial, Helvetica, sans-serif"><br>
</font></div>
<div><font face="Calibri, Arial, Helvetica, sans-serif">String >> </font><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">withArticle</span></div>
<div><font face="Calibri, Arial, Helvetica, sans-serif">
<div><span style="white-space:pre-wrap"></span>^ self article , ' ' , self capitalized</div>
</font></div>
<div><font face="Calibri, Arial, Helvetica, sans-serif">
<div><br>
</div>
</font></div>
<div><font face="Calibri, Arial, Helvetica, sans-serif">
<div>
<div>Symbol >> withArticle</div>
</div>
</font></div>
<div><font face="Calibri, Arial, Helvetica, sans-serif">
<div>
<div><span style="white-space:pre-wrap"></span>^ self article , self capitalized</div>
</div>
</font></div>
</blockquote>
<div><font face="Calibri, Arial, Helvetica, sans-serif">
<div></div>
</font></div>
<div><font face="Calibri, Arial, Helvetica, sans-serif">
<div><br>
</div>
<div>Theoretically, we could also put them into the '*System-Support' category. Not sure about this.</div>
<div>Looking forward to your opinions :-)</div>
<div><br>
</div>
<div>Best,</div>
<div>Christoph</div>
</font></div>
</div>
</div>

<br>
</blockquote></div>