<div dir="auto">Regarding canUnderstand:, maybe it's time for the third boolean called "it depends" or "maybe". ;-)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Thiede, Christoph <<a href="mailto:Christoph.Thiede@student.hpi.uni-potsdam.de">Christoph.Thiede@student.hpi.uni-potsdam.de</a>> schrieb am Fr., 31. Jan. 2020, 10:43:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div>


<div dir="ltr">
<div id="m_-2230043140418705437x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif">
<p>> <span>Question is, should X class>>canUnderstand: be overwritten, too?</span></p>
<p><span><br>
</span></p>
<p><span>This would not be possible in my example, would it? Each json object understands different keys ... This is also why I favor #respondsTo: over #canUnderstand: in general.</span></p>
<p><span><br>
</span></p>
<p>Best,</p>
<p>Christoph</p>
<div id="m_-2230043140418705437x_Signature">
<div id="m_-2230043140418705437x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper">
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%">
<div id="m_-2230043140418705437x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <<a href="mailto:squeak-dev-bounces@lists.squeakfoundation.org" target="_blank" rel="noreferrer">squeak-dev-bounces@lists.squeakfoundation.org</a>> im Auftrag von Tobias Pape <<a href="mailto:Das.Linux@gmx.de" target="_blank" rel="noreferrer">Das.Linux@gmx.de</a>><br>
<b>Gesendet:</b> Freitag, 31. Januar 2020 10:30:20<br>
<b>An:</b> The general-purpose Squeak developers list<br>
<b>Betreff:</b> Re: [squeak-dev] Should you override #doesNotUnderstand: and #respondsTo: together?</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt">
<div><br>
> On 31.01.2020, at 10:14, Thiede, Christoph <<a href="mailto:Christoph.Thiede@student.hpi.uni-potsdam.de" target="_blank" rel="noreferrer">Christoph.Thiede@student.hpi.uni-potsdam.de</a>> wrote:<br>
> <br>
> Hi all,<br>
> <br>
> just struggled over the fact that Json objects provide access to their keys via #doesNotUnderstand:, but they do not override #respondsTo:. Example:<br>
> <br>
> json := Json readFromString: '{"foo": 42}'.<br>
> json foo. "42"<br>
> json respondsTo: #foo. "false"<br>
> <br>
> Question: Is this discrepancy indeed desired behavior? Or should we rather always try to override #doesNotUnderstand: and #respondsTo: together?<br>
<br>
This is actually done very seldom, IIRC.<br>
But maybe a good pattern, tho. Question is, should X class>>canUnderstand: be overwritten, too?<br>
<br>
Best regards<br>
        -Tobias<br>
<br>
> <br>
> Best,<br>
> Christoph<br>
<br>
<br>
<br>
</div>
</span></font>
</div>

<br>
</blockquote></div>