<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 7, 2014 at 1:40 PM, Chris Muller <span dir="ltr"><<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As I was programming in Squeak today, I typed a class name, including<br>
its two-letter prefix. I wondered, could Environments be used to,<br>
dynamically, only in transient memory, remove a prefix from a package?<br>
It would be nice to enjoy typing and reading the pure, unprefixed<br>
class names, but would want to keep the original prefixes when I save<br>
a new version of the package.<br></blockquote><div><br></div><div>I'm not sure what you mean by "dynamically, only in transient memory" here.</div><div><br></div><div>You could certainly load a package that has prefixed-class-names and refer to those classes without prefixes. It would be something like this:</div>
<div><br></div><div>| magmaEnv appEnv |</div><div>magmaEnv := Environment withName: 'Magma'.</div><div>magmaEnv exportSelf.</div><div><br></div><div>appEnv := Environment withName: 'My App'.</div><div>appEnv</div>
<div> import: magmaEnv removingPrefix: 'Ma';</div><div> importSelf.</div><div><br></div><div>Load your prefixed Magma classes into magmaEnv, and then write your app code in appEnv referring to Magma classes without prefixes.</div>
<div><br></div><div>Colin</div><div><br></div><div><br></div></div></div></div>