<div id="__MailbirdStyleContent" style="font-size: 12pt;font-family: calibri;color: #000000">
                                        
                                        
                                            
                                        
                                        
                                        Hi Stef,<div><br></div><div>thanks for the examples and elaborated concerns. :) We should follow your suggestions.</div><div><br></div><div>First quick thought: What about renaming #userInterfaceTheme to #scopedInTheme or something similar that does not look like an accessor?</div><div><br></div><div>Second quick thought: What about putting weak arrays onto the theme's scope-stack? How much would this slow things down?</div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div>
                                        
                                        <blockquote class="history_container" 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: #AAAAAA; margin-top: 10px;">Am 19.09.2017 10:44:30 schrieb Stéphane Rollandin <lecteur@zogotounga.net>:</p>Hello,<br><br><br>I would like to offer some technical feedback here, please do not take <br>it as a complaint directed against anyone's good work. In particular, <br>thanks again to all involved in designing the theming system. Only, <br>there are some worrisome issues in my opinion. Here we go:<br><br><br>1) The code below raises a DNU for #hardShadowOffset in SqueakTheme, <br>because #userInterfaceTheme is not used as intented (after <br>#softShadowOffset is sent, m gets popped out of the theme scope and is <br>not there anymore when #hardShadowOffset is sent):<br><br>| m uit |<br><br>m := Morph new.<br>uit := m userInterfaceTheme.<br>{uit softShadowOffset . uit hardShadowOffset}<br><br><br>However, for someone not aware of the intricacies of UserInterfaceTheme, <br>the code seems fine. In my opinion this is not a good state of affair.<br><br>Maybe the error raised here could be more explicit and in line with what <br>is really happening in the DNU, such as "There is no object in scope at <br>the moment".<br><br><br>2) Now consider the following code:<br><br>| m1 uit1 m2 uit2 |<br><br>m2 := BalloonMorph new.<br>uit2 := m2 userInterfaceTheme .<br><br>m1 := Morph new.<br>uit1 := m1 userInterfaceTheme.<br><br>{uit1 color . uit1 color}<br><br><br>When I evaluate it I get {nil . Color lightYellow1}<br><br>This is because while the first "uit1 color" does redirect to m1, the <br>second "uit1 color" redirects to m2 now that m1 has been popped out of <br>scope. This time there is no error raised, but the result is very <br>misleading.<br><br><br>3) For the record let me recall that doing<br><br>    100 timesRepeat: [Morph new userInterfaceTheme]<br><br>results in having the current theme referencing 100 morphs that will <br>never be automatically garbage-collected.<br><br><br><br>Overall the three above points make me think that the method <br>#userInterfaceTheme is much too easy to unknowingly abuse of, and when <br>this happens undesirable behaviors can be rather difficult to make sense of.<br><br>At the moment the method comment is:<br>"Call this to conveniently access properties from the current user <br>interface theme."<br><br>I believe it needs some explicit warnings about how not to use it.<br><br><br>Just my 2 cents...<br><br><br>Stef<br><br>
                        </blockquote></div>