<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Dec 22, 2013 at 1:16 PM, Chris Muller <span dir="ltr"><<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>></span> wrote:<br>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">What still remains a mystery (for me) is why we need this extra<br>
complication -- e.g., why can't I simply _import_ from other<br>
Environments. Instead, I can only import from other Environments what<br>
I've declared as their _exports_.<br>
<br>
This does not seem to be in the spirit of Smalltalk -- having to<br>
"declare" the class-API's before I can use them. I have to keep these<br>
two things "in-sync" with each other: An Environments exports with<br>
the other environments imports.<br>
<br>
It reminds me somewhat of static-typing in that it's simply a "chore"<br>
I have to do for the satisfaction of the computer but no real benefit<br>
(that I can identify) for the developer...</blockquote><div><br></div><div>Think of exports as a kind of encapsulation for environments. If you just want the simple case of "expose everything" you can do that very simply. But if you want to do something a little more explicit, as with Xtreams, you can do that too. </div>
<div><br></div><div>You are right that it's not strictly necessary to have exports, since you can define any policy you want at the import side. But exports allow us to remove duplication in setting policies. Imagine that I have several other environments that use Xtreams. There's two ways I could hook them up.</div>
<div><br></div><div>If I use imports to set the policy, I'd do something like this:</div><div><br></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote">
<div><font face="georgia, serif">xtreamsEnv exportSelf.</font></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><font face="georgia, serif">envOne from: xtreamsEnv import: #Incomplete.</font></div></div>
</div><div class="gmail_extra"><div class="gmail_quote"><div><font face="georgia, serif">envTwo from: xtreamsEnv import: #Incomplete.</font></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><font face="georgia, serif">envThree form: xtreamsEnv import: #Incomplete.</font></div>
</div></div></blockquote><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div> If I use exports to set the policy, it looks like this:<br></div><div><br></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div class="gmail_extra"><div class="gmail_quote"><div><font face="georgia, serif">xtreamsEnv export: #Incomplete.</font></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><font face="georgia, serif">envOne import: xtreamsEnv.</font></div>
</div></div><div class="gmail_extra"><div class="gmail_quote"><div><font face="georgia, serif">envTwo import: xtreamsEnv.</font></div></div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div class="gmail_extra"><div class="gmail_quote"><font face="georgia, serif">envThree import: xtreamsEnv.</font></div></div></blockquote><div><br></div><div>They have the same end result, but notice the duplication in the first version. If a new version of Xtreams comes out that includes another public exception, consider the changes I have to make. With imports, I'd do this:</div>
<div><br></div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><font face="georgia, serif">envOne from: xtreamsEnv import: #Underflow.</font></div>
</div><div class="gmail_extra"><div class="gmail_quote"><font face="georgia, serif">envTwo from: xtreamsEnv import: #Underflow.</font></div></div><div class="gmail_extra"><div class="gmail_quote"><font face="georgia, serif">envThree form: xtreamsEnv import: #Underflow.</font></div>
</div></blockquote><div class="gmail_extra"><div class="gmail_quote"></div></div></div><br><div class="gmail_extra"><div class="gmail_quote"><div>With exports I only have to make the change in one place:</div><div><br></div>
</div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><div><font face="georgia, serif">xtreamsEnv export: #Underflow</font></div></div></div></blockquote>
<div class="gmail_extra"><div class="gmail_quote"><div><br></div><div><br></div><div>So the problem of "keeping things in-sync" is actually made easier with exports. For simple cases, sure, just #exportSelf and move on, but for more complex setups it's valuable.</div>
<div><br></div><div>Colin</div></div></div></div>