[Pharo-dev] Probably stupid... question about string printString.

Torsten Bergmann astares at gmx.de
Sun Oct 22 04:40:41 EDT 2017

Alistair Grant wrote:
> I can't comment on the original thinking behind this

The original thinking is simple and as the name says: you want to print the
object (even when it is a string) to be print in a string.

So it always is a "printObjectInString" instead of a "printObjectAsString"
behavior. Also the resulting string often is a string to easily reconstruct the object.

So it is not a conversion method. There is #asString for that.

> If we're displaying values such as numbers and strings in a UI, e.g.
> table, we normally don't want the strings always enclosed in quotes.

There is #displayString for this task (which may return the printString or is overwritten)
and this is common in nearly all Smalltalks I know.


More information about the Pharo-dev mailing list