i like that idea. if i ever manage to make up my own smalltalk, or my own language, that will defiantly by considered in making it.<br clear="all">David Zmick<br>/dz0004455\<br><a href="http://david-zmick.co.cc">http://david-zmick.co.cc</a><br>
<br><br><div class="gmail_quote">On Thu, Nov 27, 2008 at 11:08 PM, Ralph Boland <span dir="ltr"><<a href="mailto:rpboland@gmail.com">rpboland@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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 use a compromise. <br>
<br>Lets say that symbol @ is special and cannot be used as a regular message<br>and let var be an instance variable of a class MyClass and used in MyClass<br>method myMethod.<br><br>Then to access var in myMethod we can write:<br>
<br> @ var.<br><br>as in:<br><br> ^ @ var<br><br>or even:<br><br> @ 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 instance variable var or an error message would be generated.<br><br>The other way of doing this would be to not require that MyClass define var. However, if var is not defined, then myMethod would be abstract and unusable<br>
by MyClass. Instead only subclasses of MyClass that define <br>instance variable var could use the myMethod. This would mean that versions<br>of myMethod would need to 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 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, symbol @ 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><font color="#888888"><br>Ralph Boland<br>
</font><br><br>
<br></blockquote></div><br>