<br><br><div class="gmail_quote">On Wed, Nov 11, 2009 at 3:56 PM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
@Levente..<br>
there is no need to introduce a &#39;containsNil&#39; flag, nor use other than<br>
nil filler object.<br>
The tally ivar, which is already there can be used to reflect if set<br>
contains nil:<br>
<br>
tally &gt;= 0  - set contains tally number of elements without nil<br>
tally == -1 - set contains only single element - nil<br>
tally &lt; -1  - set contains a (tally abs) number of elements including nil<br>
<br></blockquote><div><br></div><div>Neat.  It might be even easier to use floating point to indicate nil :)</div><div>So if</div><div>        tally class = SmallInteger</div><div>it doesn&#39;t include nil, but if</div>
        tally class = Float</div><div class="gmail_quote">it does.  Once tally has been set to a Double all the loops still work, increasing the tally still works, etc.</div><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

i can implement it, if you want.<br>
<br>
The number of changes is quite minimal, and won&#39;t make image to die<br>
violently, because:<br>
 - currently all sets having tally &gt;=0, so even if you change things<br>
to support nils as i proposing, no existing sets having chances to<br>
behave differently<br>
 - currently all sets can&#39;t meaningfully include nil, and there is no<br>
code which intentionally puts nil in sets, because it leads to error.<br>
<br>
2009/11/12 Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt;<br>
&gt;<br>
&gt; On Wed, Nov 11, 2009 at 3:14 PM, Russell N Hyer<br>
&gt; &lt;<a href="mailto:hrothgar.ofstingan@gmail.com">hrothgar.ofstingan@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; I still don&#39;t comprehend the purpose behind having more than one<br>
&gt;&gt; flavour of empty in regards to empty set based mathematics.<br>
&gt;<br>
&gt; nil is an object like any other, and Sets can contain arbitrary objects.<br>
&gt; An empty Set contains no objects.  The fact that internally an empty Set has<br>
&gt; some slots intialized to nil is an implementation detail that in no way<br>
&gt; implies that it contains nil.<br>
&gt; So if sets are capable of including arbitrary objects they should be able to<br>
&gt; contain nil.  There are lots of contexts in which having collections that<br>
&gt; can include nil is useful.  The compiler is one.  Storing and reconstituting<br>
&gt; object graphs is another.<br>
&gt; Or in summary nil ~~ #isEmpty.<br>
&gt; HTH<br>
&gt; Eliot<br>
&gt;&gt;<br>
&gt;&gt; 2009/11/11, Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;:<br>
&gt;&gt; &gt; Just want to add that enabling a set to contain nils already discussed<br>
&gt;&gt; &gt; before.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; <a href="http://n4.nabble.com/squeak-dev-Letting-Set-contain-nils-td69437.html#a69437" target="_blank">http://n4.nabble.com/squeak-dev-Letting-Set-contain-nils-td69437.html#a69437</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ... and as you may guess, i supporting Levente in this :)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; Best regards,<br>
&gt;&gt; &gt; Igor Stasenko AKA sig.<br>
&gt;&gt; &gt;<br>
<br>
<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">Best regards,<br>
Igor Stasenko AKA sig.<br>
<br>
</div></div></blockquote></div><br>