scoped imports
Timothee Cour
thelastmammoth at gmail.com
Sun Aug 18 18:16:35 PDT 2013
On Sun, Aug 18, 2013 at 7:52 AM, Joseph Rushton Wakeling <
joseph.wakeling at webdrake.net> wrote:
> On Sunday, 18 August 2013 at 09:52:29 UTC, Timothee Cour wrote:
>
>> On Sun, Aug 18, 2013 at 2:31 AM, Joseph Rushton Wakeling <
>> joseph.wakeling at webdrake.net> wrote:
>>
>> On Sunday, 18 August 2013 at 01:33:51 UTC, Timothee Cour wrote:
>>>
>> granted, that's not ideal. How about the other points I mentioned?
>> void fun(){
>> version=A;
>> version(none):
>> }
>>
>
> Not sure I understand what you're trying to achieve there.
goal1: avoid polluting global module name space:
void fun(){
version=A;
//now the code below in fun() scope has version(A) set
}
goal2:
void fun(){
version(none):
//all the code below this IN THIS FUNCTION becomes versioned out
//(avoids requiring extra {} scope
}
> But as an alternative to function-local import, why not split your module
> into a package, with submodules mymodule.bardependent and
> mymodule.nonbardependent ... ?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20130818/7cfc4506/attachment.html>
More information about the Digitalmars-d-learn
mailing list