My idea here is too late for squeak but is food for thought <br>for the next great object oriented programming language.<br><br>Instead of using a full fledged message send for accessing<br>instance variables we could&nbsp; use a compromise.&nbsp; <br>
<br>Lets say that symbol&nbsp; @&nbsp; is special and cannot be used as a regular message<br>and let&nbsp; var be an instance variable of a class MyClass and&nbsp; used in MyClass<br>method myMethod.<br><br>Then to access var in myMethod we can write:<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @ var.<br><br>as in:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^ @ var<br><br>or even:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @ var := 5.<br><br clear="all">With this notation local variables and instance variable are distinguishable<br>which results in safer and (arguably) more readable code.<br>
<br><br>One way of implementing this would be to require that MyClass<br>define&nbsp; instance variable var or an error message would be generated.<br><br>The other way of&nbsp; doing this would be to not require that MyClass define var.&nbsp; However, if&nbsp; var is not defined, then myMethod would be abstract and unusable<br>
by MyClass.&nbsp; Instead only subclasses of MyClass that define <br>instance variable var could use the myMethod.&nbsp; This would mean that versions<br>of myMethod would need to&nbsp; be compiled for each subclass that defined var.<br>
If the additional byte code generated was considered too wasteful then<br>one could always use regular message sends.<br>I would strongly recommend that&nbsp; abstract variables (such as var) and abstract<br>methods somehow be clearly marked.<br>
I would also recommend that, when var is defined in a subclass,&nbsp; symbol&nbsp; @ be<br>placed in front of it to flag that an abstract variable is being made concrete<br>as opposed to a brand new instance variable being created.<br>
<br>(calm) opinions welcome.<br><br>Ralph Boland<br>