<div dir="ltr"><div dir="ltr">On Mon, Jun 10, 2024 at 11:01 AM <<a href="mailto:ken.dickey@whidbey.com">ken.dickey@whidbey.com</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">On 2024-06-10 07:42, Mark Volkmann via Cuis-dev wrote:<br>
<br>
> I'm learning about overriding the `doesNotUnderstand` method in a class <br>
> to support processing somewhat arbitrary messages. But the Smalltalk <br>
> editor is perhaps being too helpful. It doesn't want to let me send an <br>
> "unknown selector". So it's not clear to me how I can send a message <br>
> that will trigger my implementation of the `doesNotUnderstand` method. <br>
> Is there a way I can do this?<br>
<br>
When you save the method, you can just `confirm` this selector is what <br>
you want.<br>
<br>
It is useful to have unknown selectors, BTW to "debug code into <br>
existence".  Just keep running the code and write code for the selectors <br>
as they come up as missing into the debugger.<br>
<br>
Use of #doesNotUnderstand is frequently the wrong thing to do.<br></blockquote><div><br></div><div dir="ltr">Thanks Ken! I was finally able to get my demo code working. A fileOut is attached.</div><div dir="ltr"><br><div>I see how the thing I implemented is not really a good idea. I was just trying to learn how `doesNotUnderstand` works.</div><div>I have a class method `demo` that demonstrates using my `Map` class with the following:</div><div><br></div><div><font face="monospace">map := Map new.<br>map firstName: 'Mark'.<br>       map firstName print</font><br></div><div><br></div><div>The `Map` class has an instance variable that holds a `Dictionary`. Sending messages to a `Map` instance accessed the `Dictionary`. This lets me specify `Dictionary` keys with arbitrary messages. But an issue I discovered is that this breaks if the message name matches an existing method like `name`. I know I should just stick with sending `:at` and `:at:put` to a `Dictionary`. This was just a learning exercise.</div></div></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div></div>