digitalmars.D.learn - imports other than at the top
- Bill Baxter (8/8) Oct 24 2006 I tried sticking an import in a unittest {} block and it caused an error...
- Lionello Lunesu (5/16) Oct 25 2006 I've noticed that imports can be placed in a version { } block, and I'd
- Bill Baxter (4/20) Oct 25 2006 Ok, well that's good at least. I wonder if there is (or could be) a
- Thomas Kuehne (10/29) Oct 25 2006 -----BEGIN PGP SIGNED MESSAGE-----
- Bill Baxter (4/13) Oct 25 2006 That was fast!
I tried sticking an import in a unittest {} block and it caused an error. I put it there, naturally, because I only needed that particular module for the unittests and the whole rest of the file didn't really need to see those symbols. If you're not doing unittests there's no reason for the import overhead, and no reason to burden the user with making sure that particular testing module is present. Scoped importing like that just not supported at this time? --bb
Oct 24 2006
Bill Baxter wrote:I tried sticking an import in a unittest {} block and it caused an error. I put it there, naturally, because I only needed that particular module for the unittests and the whole rest of the file didn't really need to see those symbols. If you're not doing unittests there's no reason for the import overhead, and no reason to burden the user with making sure that particular testing module is present. Scoped importing like that just not supported at this time? --bbI've noticed that imports can be placed in a version { } block, and I'd assume inside a debug { } too.. But inside of unittest { } there's actual code being executed, so it's probably a different kind of scope. L.
Oct 25 2006
Lionello Lunesu wrote:Bill Baxter wrote:Ok, well that's good at least. I wonder if there is (or could be) a version(unittest) automatically set when -unittest is used. --bbI tried sticking an import in a unittest {} block and it caused an error. I put it there, naturally, because I only needed that particular module for the unittests and the whole rest of the file didn't really need to see those symbols. If you're not doing unittests there's no reason for the import overhead, and no reason to burden the user with making sure that particular testing module is present. Scoped importing like that just not supported at this time? --bbI've noticed that imports can be placed in a version { } block, and I'd assume inside a debug { } too.. But inside of unittest { } there's actual code being executed, so it's probably a different kind of scope.
Oct 25 2006
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bill Baxter schrieb am 2006-10-25:Lionello Lunesu wrote:http://d.puremagic.com/issues/show_bug.cgi?id=458 Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFP02aLK5blCcjpWoRAqHgAKCnpwQBdeO6foA/0gddXVw+hF1p/wCeLnRQ gh3CWZJdc6gHhcV10aPcy7Q= =ZDwC -----END PGP SIGNATURE-----Bill Baxter wrote:Ok, well that's good at least. I wonder if there is (or could be) a version(unittest) automatically set when -unittest is used.I tried sticking an import in a unittest {} block and it caused an error. I put it there, naturally, because I only needed that particular module for the unittests and the whole rest of the file didn't really need to see those symbols. If you're not doing unittests there's no reason for the import overhead, and no reason to burden the user with making sure that particular testing module is present. Scoped importing like that just not supported at this time? --bbI've noticed that imports can be placed in a version { } block, and I'd assume inside a debug { } too.. But inside of unittest { } there's actual code being executed, so it's probably a different kind of scope.
Oct 25 2006
Thomas Kuehne wrote:That was fast! Thanks, Thomas. --bbhttp://d.puremagic.com/issues/show_bug.cgi?id=458 ThomasI've noticed that imports can be placed in a version { } block, and I'd assume inside a debug { } too.. But inside of unittest { } there's actual code being executed, so it's probably a different kind of scope.Ok, well that's good at least. I wonder if there is (or could be) a version(unittest) automatically set when -unittest is used.
Oct 25 2006