Eliminating assignments and variable syntax (accessors)

agree at carltonfields.com agree at carltonfields.com
Fri Aug 13 22:37:26 UTC 1999


> So it might be cool to be able to do something like this:
> > 	x<3 		ifTrue:
> 			y := y + 1
> 		ifFalse:
> 			z := z + 1

This must be some new use of the word "cool."

> > But this doesn't look perfect, either--it takes 5 lines when > 3 or even 1 would do.  So, maybe allow the [ ] syntax for > blocks that are only one statement long?
> > 	x < 3
> 		ifTrue: [ y := y + 1 ]
> 		ifFalse:
> 			z := z + 1.
> 			m := m * m.

Let us remember that a fundamental difference between Smalltalk and Python is that Python's control structures are syntactic entities, while Smalltalk's are part of the messaging structure.  What we do for ifTrue:ifFalse: will apply equally for each and every other message schema.

I frankly don't think that Guido's brilliant execution of indentation-as-syntax in Python, of which I am very, very fond, translates well to Smalltalk.  The angels-on-a-pinhead-counting agonizing over the virtues, meanings and utility of these examples, at least to me, proves the point.

Why would we ever consider doing this to Smalltalk?  This is the question we must address as a threshold issue, before we start hacking out the implementation details.  Before we even consider what is "cool" and what is "neat," let's try first to agree on a more core issue of what bases, if any, we would use to choose one approach over another.  Until we can, this is all just religious banter.  What objective means would we use to decide whether a proposal is a good thing.





More information about the Squeak-dev mailing list