<div><div dir="auto">Yeah, we talked about this last time namespaces came up in this list, I like it, and I’d be happy with a simple implementation without special tools. Perhaps instead of aiming for a solution for the base image we should try to implement Environments or something similar as a package. What would be nice is that we stopped using the global Smalltalk everywhere, specially in the tools, and started using something like ‘aClass environment’ that defaults to Smalltalk.</div></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 2 May 2020 at 6:28 AM, Hernan Wilkinson <<a href="mailto:hernan.wilkinson@10pines.com">hernan.wilkinson@10pines.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div> interesting thread!!</div><div> Class name prefix are not nice but it is very easily to get used to them. When you got use to them when you read something like WAHtmlCanvas, your mind disregards the WA and focus on HtmlCanvas. Prefix do not look nice, but they solve the problem of name clashing in a simple way and without adding anything special... but namespaces look as a better "engineering" solution :-)</div><div> Many details have to be take care when implementing namespaces, it is not that simple. The implementation I liked about this was Geman Leiva's one, showed at ESUG 2010. Here is a video showing it: <a href="https://www.youtube.com/watch?v=n4I7fSVNX2A" target="_blank">https://www.youtube.com/watch?v=n4I7fSVNX2A</a></div><div> It was a clean, Smalltalk like solution and, if I recall correctly, it did not have a performance hit.</div><div><br></div><div>Cheers!</div><div>Hernan.</div><div><br></div></div><br><div class="gmail_quote"></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 30, 2020 at 3:56 PM Juan Vuletich via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st" target="_blank">cuis-dev@lists.cuis.st</a>> wrote:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"></blockquote></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div bgcolor="#ffffff">
On 4/29/2020 12:57 AM, Luciano Notarfrancesco via Cuis-dev wrote:
<blockquote type="cite">
<div><br>
</div>
<div><br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, 28 Apr 2020 at 8:52
PM, Juan Vuletich <<a href="mailto:juan@jvuletich.org" target="_blank">juan@jvuletich.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Without backticks, we'd need to add packages as globals, so
they can be <br>
resolved at runtime. With the backticks we can avoid that,
because we <br>
can give the Compiler the context to resolve package names
if in a <br>
required package, just like class names, at compile time.<br>
</blockquote>
<div dir="auto">
<div dir="auto" style="font-size:1rem;color:rgb(49,49,49);word-spacing:1px"><br>
</div>
<div dir="auto" style="font-size:1rem;color:rgb(49,49,49);word-spacing:1px">But that would work regardless of
back ticks, right? Erik doesn’t like backticks very much,
I also avoid them in my code.</div>
<div dir="auto" style="font-size:16px;color:rgb(49,49,49);word-spacing:1px"><br>
</div>
<div dir="auto" style="font-size:1rem;color:rgb(49,49,49);word-spacing:1px">I just did some experiments
changing Class>>bindingOf:. Currently it first looks
in class var names and SharedPools calling
localBindingOf:, then it looks in globals by calling
Smalltalk bindingOf:. I added a packageBindingOf: after
localBindingOf:, and if self package is not nil it tries
to resolve the binding within the package. We can put
required packages here and they will look like globals,
right? And also resolve classes of the local package.</div>
</div>
</div>
</div>
</blockquote>
<br>
You are right! Yes, the backticks are optional. There is still the
message send to get the class. So there is some performance penalty,
and some users in critical code might still prefer to use them, so
the literal is the class and not the module. But it is a small
detail.<br>
<br>
<blockquote type="cite">
<div>
<div class="gmail_quote">
<div dir="auto">
<div dir="auto" style="font-size:1rem;color:rgb(49,49,49);word-spacing:1px">I tried one of the ideas: keeping
all classes global, but adding a prefix like
‘PackageName.’ to the binding key in the Smalltalk system
dictionary. I added a Class>>globalName too. Seems
to almost work, but tools break all over the place.</div>
</div>
<div dir="auto"><br>
</div>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
</blockquote>
</div>
</div>
</blockquote>
<br>
Cheers,<br>
<pre cols="72">--
Juan Vuletich
<a href="http://www.cuis-smalltalk.org" target="_blank">www.cuis-smalltalk.org</a>
<a href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev" target="_blank">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a href="https://github.com/jvuletich" target="_blank">https://github.com/jvuletich</a>
<a href="https://www.linkedin.com/in/juan-vuletich-75611b3" target="_blank">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</pre>
</div></blockquote></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
-- <br></blockquote></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
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>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><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></span></strong></span></div><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><span style="font-size:small"><font size="2"><span style="font-weight:normal">Phone: +54-011</span></font></span></span></span></strong></span><font face="tahoma, sans-serif" size="2">-4893-2057</font></div><div><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><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><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></span></strong></span></div><div><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></div></div></div></div>
</blockquote></div></div>