<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Very cool implementation, Tony! I admit that I did not watch the entire video, but what I could see from the screenshots looks great. It feels kind of something that has always been missing in Smalltalk for eternities.</p>
<p><br>
</p>
<p>How large is your entire patch? Provided it's not huge, I would vote for introducing these changes into the Trunk.</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
<div id="x_Signature">
<div id="x_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" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Tony Garnock-Jones <tonyg@leastfixedpoint.com><br>
<b>Gesendet:</b> Dienstag, 30. März 2021 14:12:45<br>
<b>An:</b> The general-purpose Squeak developers list<br>
<b>Betreff:</b> [squeak-dev] Nested Environments demo</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi all,<br>
<br>
I recorded a little screencast of the EnvironmentBrowser I've been <br>
playing with:<br>
<br>
<a href="https://www.youtube.com/watch?v=1UOyca5-72Y">https://www.youtube.com/watch?v=1UOyca5-72Y</a><br>
<br>
it's ~11 minutes long if you watch it at 1:1. In the description of the <br>
video is the outline that I was following as I recorded the talk.<br>
<br>
I'll paste it below as well.<br>
<br>
Cheers,<br>
   Tony<br>
<br>
-=-=-=-=-<br>
<br>
[Here's the outline I was following as I recorded this talk.]<br>
<br>
Hi everyone.<br>
<br>
I'm Tony Garnock-Jones, it's March 30th 2021, and I'm going to walk <br>
through the experimentation I've been doing on nested Namespaces in <br>
Squeak Smalltalk.<br>
<br>
This work builds on Squeak's Environments, which I think are originally <br>
due to Colin Putney with some recent work by Jakob Reschke.<br>
<br>
I've made some small additions to Environment, and a little subclass <br>
called Namespace, which allows one to expose Environments via ordinary <br>
variable reference, if one so chooses. It doesn't change anything about <br>
how Environments work otherwise, so existing uses should remain unchanged.<br>
<br>
I've also added a variant of Browser that shows these accessible <br>
Environments in a hierarchy, and allows you to manage their imports and <br>
exports. Here it is.<br>
<br>
[Open an EnvironmentBrowser]<br>
[Navigate to EnvironmentBrowser]<br>
<br>
The tool is called EnvironmentBrowser, and it's a very thin veneer over <br>
the existing underlying Environment machinery.<br>
<br>
You can see that compared to the default browser, it has a couple of <br>
extra panels.<br>
<br>
This one [on the left] is a tree of environments. The idea is to take <br>
Environment's Instances as "well-known" roots for this tree:<br>
<br>
   Environment wellKnownInstances<br>
<br>
Smalltalk is already in there, and at the moment there are no others.<br>
<br>
 From the roots, we recursively scan each environment for globals that <br>
are also Environments. This scan is a part of Environment itself:<br>
<br>
[Navigate to Environment's namespaceTreeDo: method]<br>
<br>
This other panel [on the left, just below the tree of environments] <br>
shows the imports and exports of this environment.<br>
<br>
Here you can see that the default environment, Smalltalk, imports all <br>
its own bindings, so they're visible to its own classes, and exports all <br>
its bindings to other Environments that import from Smalltalk.<br>
<br>
[Create namespace NS1]<br>
[Create class String, extends Object, inst var length, category Demo]<br>
[Create accessors]<br>
<br>
printOn: aStream<br>
        aStream nextPutAll: 'I am a ball of wool ', length, ' metres long'<br>
<br>
[class side]<br>
new: size<br>
        ^ self new length: size<br>
[Proceed on the warning]<br>
<br>
[Open workspace in Smalltalk]<br>
String new: 3<br>
<br>
[Open workspace in NS1]<br>
String new: 3<br>
<br>
[Rename NS1 to Fabric]<br>
[Create namespace NS2]<br>
[Import Fabric with prefix Fabric]<br>
<br>
[Open workspace in NS2]<br>
String new: 3<br>
FabricString new: 3<br>
"Oh! It didn't work! We didn't export it from Fabric."<br>
<br>
[Export all from Fabric]<br>
[Try again - still doesn't work]<br>
[Redo the import]<br>
[Try again - works now!]<br>
<br>
There are still some issues with, I think, Environments themselves <br>
propagating changes to each other.<br>
<br>
Fabric String new: 3<br>
<br>
[Unlink Fabric]<br>
<br>
Now we see:<br>
<br>
String new: 3<br>
FabricString new: 3<br>
Fabric String new: 3  "error on this, Fabric is missing"<br>
<br>
[Remove the policy importing Fabric to NS2]<br>
<br>
Didn't remove it. Still some bugs.<br>
<br>
</div>
</span></font>
</body>
</html>