That crazy dot idea

Stefan Matthias Aust sma at mail.netsurf.de
Sat Mar 20 22:24:08 UTC 1999


Bob,

>I would have expected (3 a DotTest 1 )

You're right, that should be the result. I messed up the Object>>dotAt:put:
method.  Please use 

dotAt: aSymbol put: anObject
	self perform: (aSymbol copyWith: $:) asSymbol with: anObject.
	^ anObject

instead.  Then, you should get the expected result. Thank you for reporting
that problem.  

>It also points out that the current compiler doesn't require a lot of
>white space to do its job. This may cause some confusion if coding 
>styles vary as they tend to.

Well, in the normal grammar, there was just one ambiguity:
"a:=1.5factorial" can be interpreted as "a:=(1.5 factorial)" or as "a:=1. 5
factorial", that is, a period between two numbers requires a separator
character when it shouldn't be interpreted as a float literal.  Now, I
added another ambiguity: a period immediately followed by a period is
interpreted as a dot for dot-access.  This might break existing code and
will definitly be irritating when used in programs without more than the
absolutly needed number of spaces.

However, I think it still was the convention in Smalltalk, separate all
operators and selectors by spaces and also to add a space (or a CR) behind
periods.

PS: the "browse with pretty printing" command will break my extension
because it obviously shows decompiled byte code and the decompiler wasn't
patched.


bye
--
Stefan Matthias Aust  //  ...and now something completely different





More information about the Squeak-dev mailing list