<body><div id="__MailbirdStyleContent" style="font-size: 12pt;font-family: calibri;color: #000000">
Well, not good. :) Then you would rely on a quite hidden side effect. You do not know in advance how the object stored in a theme will be used by the client. It is not always a simple instVar write.<div><br></div><div>Consider this example:</div><div><br></div><div><div>slider borderColor: ((self userInterfaceTheme borderColorModifier</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ifNil: [ [:c | c adjustBrightness: -0.3] ]) value: aColor).</div></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;">
<p style="color: #AAAAAA; margin-top: 10px;">Am 19.09.2017 12:19:17 schrieb Stéphane Rollandin <lecteur@zogotounga.net>:</p>> Well, on the one hand, we do want to avoid the need for parentheses:
<br>>
<br>> self color: (self themed: #color)
<br>Hmm... if we are sure that all setters are always named from the
<br>getters, then this may do the trick:
<br>
<br> Object>>getThemed: aSelector ifNone: defaultValue
<br> self perform: (aSelector, ':') asSymbol
<br> with: ((self themed: aSelector) ifNil: [defaultValue])
<br>
<br>Then
<br>
<br> self color: (self userInterfaceTheme color ifNil: [Color yellow])
<br>
<br>would become:
<br>
<br> self getThemed: #color ifNone: Color yellow
<br>
<br>
<br>The only hurdle I see is the #asSymbol send which may slow things down a
<br>little.
<br>
<br>
<br>Stef
<br>
</blockquote>
</div></body>