Eliminating assignments and variable syntax (accessors)

Daniel Allan Joyce daniel.a.joyce at worldnet.att.net
Sat Aug 14 05:21:32 UTC 1999


> 
> In fact, it's surely easier for an author to notice an extra tab floating around, than it is for them to notice an extra [ tossed in somewhere.
> 
> > >
> > >This syntax also works out fine for storing a block into a variable:
> > >
> > >     myMethod
> > >             | b x y |
> > >             b :=
> > >                     x := 1
> > >                     y := 2
> > >             ^b
> > >
> > >It doesn't *look* real nice, but the fact that it's different is surely a
> > >big contributor.
> >
> > However big a contributer it may be, it's contribution is *totally* swamped
> > by the contribution of the intrinsic butt-ugliness of it :) Ugh. Espeically
> > with the caret making the "b"s visually misalign!
> >
> 
> Heheh, well, okay.  Can't really argue with you there. :)
> 
> Lex

Why use indentation to MEAN something? Indentation based languages are
horrid, and hard to read. Besides, whats wrong with [] for blocks? I'll
keep delimiters over tabs anyday. Modula-3 code is hard to read in large
programs, because you have to keep visually lining up the indents. At
least in C, I can count {'s and }'s and test nesting. 

About the whole assignment speil, I think whats needed is way of
specifying 'self' without typing it, like a special character, or way of
denoting a function. That would be short, and sweet.

	Is the apostrophe used?
	so, instead of "self foo"
	we can say "`foo", or some other perhaps more noticeable symbol...

And simple accessors? Always include them, even if they don't do
anything but return or access inst vars. A good SmallTalk compiler will
always inline anyways, and thuse no need to worry about the extra
message sends. You may need to change them in the future anyways. By
including them from the start, you won't have to go through an object,
and change every occurence of 'a :=' to 'self a:'.  It's bitten me on
the rear a few times. 

And if its too hard to type 4 extra chars for 'self', well, there is a
point were efficency becomes laziness. I mean, CS people are lazy, but
THAT lazy? 

	:)

	Daniel Joyce





More information about the Squeak-dev mailing list