What replaces "with"?
<p>I know <code>with</code> is supposedly a "Bad Part" but I never cared, because I just used it carefully (ditto, btw, with <code>var</code> statements in blocks). Now, I understand that <code>with</code> has been banished from EcmaScript 5.0 strict mode.</p>

<p>Here's my use-case: I have a library that exports some 20 or 30 functions. Most of my code never uses any of the library but the parts that do, use them <em>a lot</em>.</p>

<p>Right now, my code looks like:</p>

<pre><code>with (mylib) {
    f1(f2(f1(), f3())); // five or 10 more lines like this
}
</code></pre>

<p>To be compliant, I will have to...</p>

<p>a) Move all of the functions to global scope (yuck).</p>

<p>b) <code>mylib.f1(mylib.f2(mylib.f1(), mylib.f3()));</code> (which is verbose) </p>

<p>c) <code>var x = mylib; x.f1(x.f2(x.f1(), x.f3()));</code> (which is slightly less verbose but less meaningful).</p>

<p>Please tell me that there's some better solution out there now.  What I want is some way to export the contents of a object into a level of scope (which is <em>exactly</em> what <code>with</code> was for).</p>

<p><strong>EDIT:</strong></p>

<p>Something I should have made clearer.  I don't want people to explain to me why I don't want to do what I do want to do; I want people to explain to me <em>how</em> to do what I do in fact want to do.</p>

<p>The thing is, for reasons beyond my control, the exports of the library all have <em>very</em> recognizable names.  Instead of calling them f1, f2, and so on, let's say they're called Bobs_Library_Function_F1, Bobs_Library_Function_F2, and so on.</p>

<p>I just don't want a lot of code that looks like </p>

<pre><code>Bobs_Library.Bobs_Library_Function_F1(Bobs_Library.Bobs_Library_Function_F2(Bobs_Library.Bobs_Library_Function_F1(), Bobs_Library.Bobs_Library_Function_F3()));
</code></pre>

<p>(The real names aren't that bad, they're quite beautiful actually, and prefixing cuts into that.)</p>

<p>Anybody who <em>seriously</em> disagrees here, well, I hope you never use <code>$.whatever</code> when you are supposed to be using <code>jQuery.whatever</code> because that would make you look like a big ole hypocrite.  </p>

<p>I'm thinking of using <code>$$.f1</code>...</p>

<p><strong>FURTHER EDIT</strong></p>

<p>Seriously, thanks for all the input, but I'm not looking for a poll on whether (a), (b), or (c) is the best. I'm looking for choice (d) that does what <code>with</code> does so well.</p>

<p>Do I at least get block-scoping out of strict mode?</p>
