<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
 --></style><title>Re: Eliminating assignments and variable syntax
(acces</title></head><body>
<div>&nbsp;<br>
</div>
<div>&quot;Jarvis, Robert P.&quot; wrote:<br>
</div>
<blockquote type="cite" cite>Thanks for the explanations.&nbsp; What
troubles me is that the grammar of the<br>
language now becomes more complex, in my opinion, rather than
simpler.&nbsp; ...<br>
</blockquote>
<div><font size="+1"><b>NO !</b></font> We would have a much more
simple syntax for Smalltalk: there would be no assignment to
variable,<b> only message sends</b>, even all variable names would be
eliminated from the syntax.<br>
</div>
<div>From the point of view of syntax, the receiver would be
identified by a message send to the context and/or to the receiver.
Real access to variables (bytecodes generated by the compiler) could
be viewed as a kind of compiler optimation for this syntax (just like
some other compiler optimations - ifTrue: etc.). This optimation would
be even unambiguous (if you look at it from the point of wiev of the
&quot;new&quot; syntax - the message means something which the object
knows in the current context... - it must be a temp var, inst var or
if none of then, then some &quot;more global&quot; object).<br>
</div>
<div><i>The basic rules of OO are that there are only objects and
message sends among them and the objects react to the message send in
run-time in a polymorphic way</i>. However, immediately with the
method syntax, we have to introduce exceptions from this rules:<i><b>
there are temp vars, inst vars, class vars, globals, pool dict vars,
assignments to all of them, they are being resolved in compile time,
all variables (including globals) have to be known in compile time
(... or you have to declare them as undeclared....)</b></i>
---&gt;<font size="+1"><b> all this very understandable for a
Smalltalk beginner, isn't it ? ;-((</b></font><br>
</div>
<div>With the proposed SELF-like syntax, we could really state that
there are only message sends in Smalltalk and the first item in an
expression is a message send to itself in order to find the initial
receiver of the following message sends,. Just then we could explain,
that literals are created by compiler in compile time from optimation
reasons, even that variable access is optimized...<br>
&nbsp;<br>
</div>
<div>Augustin Mrazik</div>
</body>
</html>