<div dir="ltr"><div dir="ltr"><div dir="ltr">On Tue, Jul 21, 2020 at 3:08 PM Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de">marcel.taeumel@hpi.de</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div id="gmail-m_-7263357994648692208__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)">
                                        Maybe I can check for #isImmediateClass first :-)</div></div></blockquote><div><br></div><div>That's a good idea. Note that primitiveSomeInstance also returns nil in case no instance exists (e.g. `EToyProjectDetailsMorph someInstance == nil`).</div><div>I believe the behavior you observe wrt immediates has historical reasons:</div><div>#someInstance returns the first instance found in the object memory, and you can use #nextInstance: for iteration (this mechanism was later replaced by #allInstances). Iterating instances doesn't make sense for immediates, the "same instance" can occur multiple times in the heap.<br></div><div><br></div><div>Fabio</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div id="gmail-m_-7263357994648692208__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)"><div></div><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px">
                        <p style="color:rgb(170,170,170);margin-top:10px">Am 21.07.2020 15:07:01 schrieb Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de" target="_blank">marcel.taeumel@hpi.de</a>>:</p><div style="font-family:Arial,Helvetica,sans-serif"><div id="gmail-m_-7263357994648692208__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)">
                                        
                                        
                                            
                                        
                                        
                                        Hi Fabio.<div><br></div><div>From an object-oriented perspective, it would be nice to get "some instance" when asking a class in the system for #someInstance. :-)</div><div><br></div><div>As it is now, I have to start writing a little lookup table with "class == SmallInteger ifTrue: [ .... ]" to lookup exemplary instances for some classes in the system.</div><div><br></div><div>Best,</div><div>Marcel<br><div><br></div><div><br></div><div></div>
                                        
                                        </div><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px;min-width:500px">
                        <p style="color:rgb(170,170,170);margin-top:10px">Am 21.07.2020 14:53:31 schrieb Fabio Niephaus <<a href="mailto:lists@fniephaus.com" target="_blank">lists@fniephaus.com</a>>:</p><div style="font-family:Arial,Helvetica,sans-serif">
<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Tue, Jul 21, 2020 at 2:24 PM Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de" target="_blank">marcel.taeumel@hpi.de</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex;min-width:500px"><div id="gmail-m_-7263357994648692208gmail-m_-1249618653276569828__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)">Hi all!<div></div><div><br></div><div>Why is "SmallInteger someInstance == nil"?</div></div></blockquote><div><br></div><div>Because SmallIntegers are immediate and cannot be instantiated (`SmallInteger new` fails). This implies:</div><div><br></div><div>"SmallFloat64 someInstance == nil"</div><div>"Character someInstance == nil"</div><div><br></div><div>Why would you want someInstance of SmallInteger anyway?</div><div><br></div><div>Fabio</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex;min-width:500px"><div id="gmail-m_-7263357994648692208gmail-m_-1249618653276569828__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)"><div><br></div><div>Best,</div><div>Marcel</div></div><br>
</blockquote></div></div></div></div></div>
</div></blockquote></div></div></blockquote>
                                        </div></div><br>
</blockquote></div></div></div>