<div dir="ltr">Hi Mark,<br><div> Smalltalk is a dynamically typed language, therefore the autocompletion tries to do its best due to the lack of type info.</div><div> For sure you noticed that some selectors that the autocomplete shows are in black and some are in blue. The ones in black are the ones that for sure the receiver of that message will answer, the ones in blue are the ones that the autocomplete does not know.</div><div> In your example, the selector packages is in blue because Smalltalk is an object whose type is well known by the environment and it will not answer that message. (Please do not confuse Smalltalk the language/environment with Smalltalk the object)</div><div> Just to clarify, Smalltalk is a global var that references an object instance of SystemDictionary, if you write "Smalltalk " (without the quotes) and press tab (*), the autocompletion will show you all the messages that Smalltalk will answer for sure. If you press "p" it will show you all the selectors that start with p, but if you press "pa" you will see they are in blue, that means that Smalltalk will not answer those messages.</div><div> Inferring what messages Smalltalk will answer is simple due to what I said in the previous paragraph, but most of the cases are not like that. For example, if you have the method "m1: something", what is the type of "something"? how can we infer the messages it will answer? There are many techniques, for example type inference (but it is slow and not "complete"), another is something we implemented in Cuis called "LivedTyping" where types of variables are collected dynamically and that info is used in all the tools, specially in the autocompletion. </div><div> The UX with LiveTyping is completely different because it is like having tools of a statically typed language but in a dynamically typed one. If you want to try it, download CuisUniversity from <a href="https://sites.google.com/view/cuis-university/descargas?authuser=0">https://sites.google.com/view/cuis-university/descargas?authuser=0</a> that has LiveTyping installed. (The site is in Spanish, but you will understand :-) ).</div><div><br></div><div> I hope I answered your question, it is an interesting topic :-) If you have questions let me know.</div><div><br></div><div>Cheers!</div><div>Hernan.</div><div><br></div><div>(*) For the autocompletion to open when you press tab this preference must be set: </div><div>Preferences name: #spaceTabOpensAutoCompletion category: #gui value: true.</div><div> </div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 14, 2024 at 2:14 PM Mark Volkmann via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I'm learning about reflection in Smalltalk and trying out a bunch of related methods. When I enter <font face="monospace">Smalltalk</font> and part of a message name in a Workspace and press the tab key I get lots of suggested completions. But many of them give me <font face="monospace">MessageNotUnderstood</font> when I "Print it". For example:<div><br></div><div><font face="monospace">Smalltalk packages</font></div><div><br></div><div>Why would it suggest completions that aren't really implemented?</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></div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div style="font-size:small"><div dir="ltr"><div dir="ltr"><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal"><span style="font-weight:bold">Hernán Wilkinson</span><br>Agile Software Development, Teaching & Coaching</span></font></span></span></strong></span></div><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">Phone: +54-011</span></font></span></span></strong></span><font face="tahoma, sans-serif" size="2">-4893-2057</font></div><div style="font-size:12.8px"><strong style="font-family:tahoma,sans-serif;font-size:xx-small"><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">Twitter: @HernanWilkinson</span></font></span></span></strong></div><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">site: <a href="http://www.10pines.com/" style="color:rgb(17,65,112)" target="_blank">http://www.10Pines.com</a></span></font></span></span></strong></span></div><div style="font-size:12.8px"><font face="tahoma, sans-serif"><span style="border-collapse:collapse">Address: Alem 896</span></font>, Floor 6, Buenos Aires, Argentina</div></div></div></div></div></div></div></div>