<br><br><div><span class="gmail_quote">On 5/1/06, <b class="gmail_sendername">Nagy Attila</b> &lt;<a href="mailto:attis@gizi.dote.hu">attis@gizi.dote.hu</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Now I know what the title&nbsp;&nbsp;William Gibson's novel 'Count Zero' refers to. ;)</blockquote><div><br>Heh -&nbsp; well <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I find Laurence's solution very elegant.</blockquote><div><br>Thanks but I think you're referring to Jecel's solution which I seconded for exactly because of what Ralph suggests - &quot;program at a high level&quot;. In a case like Jecel's where hw *is* the high level his solution:
<br><br><div style="margin-left: 40px;">The current program I am writing in Squeak simulates hardware and 1<br>based arrays were a bit inconvenient, so the first thing I did was<br>define a ZArray class as a subclass of ArrayedCollection with
<br><br>at: index<br> &nbsp;^ super at: index + 1<br><br>at: index put: obj<br> &nbsp;^ super at: index + 1 put: obj<br><br>do: block<br> &nbsp; 0 to: self size - 1 do:<br> &nbsp; &nbsp; &nbsp; &nbsp; [ :index | block value: (self at: index) ]</div></div><br>
and your countZero method are quite appropriate. Chances are, particularly in the coming world of Spoon, this code wouldn't ever appear in an image being used by someone new to the Smalltalk environment. Even if it did these approaches don't interfere on any other uses of Array and wouldn't be noticed by the overwhelming majority of programmers whose &quot;high level&quot; is not hw. It's easy for the knowledgeable developer to use ZArray as needed. To me this is the best of both worlds. I would say Wolfgang, there's no need to impose one approach or another on all programmers or all situations if you &quot;program at a high level&quot;.
<br><br>Cheers,<br><br>Laurence <br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> I can even imagine adding a<br>method to Integer:<br>
<br>Integer&gt;&gt;countZero<br><br>^ self + 1<br><br>Then you could have:<br><br>someCollection at: 5 countZero<br><br>Legible and simple, what do you say?<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Attis<br><br></blockquote></div><br>