On 02/19/2017 04:37 AM, stepharong wrote:
I do not say that it is a problem of playground. I'm saying that our
tools are breaking an important invariant.
Printit should not produce "strings" that are not objects.

What I'm saying it that
      - axiom one printString returns a string.
      - printIt send printString to the object and why does it no
display a string
      except for objects whose representation is themselves.

The problem not to put '' around string is that we get a broken things.

The tools aren't the ones putting the quotes around the string. Calling #printString on a String puts the quotes around the string. If you were to put quotes around other printString's then you would need to special case String to not put the quotes around twice.

The current implementation looks right to me. #printString returns a string to help developers. #printString on some objects returns a string that when evaluated creates an equivalent object (e.g., String, Point, etc.). However, on other objects it returns a string that only helps the developer see what the object is (e.g., OrderedCollection). The trick is to know which object's printString can be evaluated and which are only for display. Of course, if you want a string that you can evaluate, you should use #storeString.


John Brant

Reply via email to