Proposal: #symbol printing

Dan Ingalls Dan.Ingalls at disney.com
Tue Apr 25 16:18:55 UTC 2000


>The only thing I changed to obtain the proposal was to implement #printOn:
>on Symbol to use #storeOn: as follows:
>
>printOn: aStream
>    self storeOn: aStream
>
>The only thing that broke was the ChangeSorter (so we changed it to behave
>correctly). All the rest has been working fine (both in 2.6 and 2.7) the
>last months.

Roel -
It is a help that you have already tried this out for a while!
Please send me any fixes you used by private mail.

>However, while playing around before answering to your mail, I
>noticed that it does not work correctly for non-literals, where the
>following happens:
>
>#'squeak rules' printstring
>
>returns the string: '''squeak rules'' asSymbol',
>which is clearly wrong ! We will have to fix that !

This is no problem.  I just had to fix it myself for symmetry in the decompiler.  Here is what I did in storeOn: (and it will be coming out today in an update named "FourTweaks"):

<Symbol>storeOn: aStream
	aStream nextPut: $#.
	self isLiteral
		ifTrue: [aStream nextPutAll: self]
		ifFalse: [super storeOn: aStream]
 . . .

>Well, with the patch as proposed above (and submitted on this list a while
>ago), there seems to be no problem.

We will try this out at SqC for the next few days (I am programming heavily).
If all seems OK, we should be able to slip it into 2.8beta.

	- Dan






More information about the Squeak-dev mailing list