digitalmars.D - Extending imports with "*"
- denisw (3/3) Mar 03 2005 I think it should be possible to import all modules stored in a specific...
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (6/10) Mar 03 2005 We all do, but meanwhile there's a few workarounds:
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (4/6) Mar 03 2005 http://www.prowiki.org/wiki4d/wiki.cgi?BestPractices
- J C Calvarese (8/18) Mar 03 2005 I don't the issue is that Walter hasn't had time to add this feature. I ...
- Matthew (8/13) Mar 03 2005 No bloody way!
- Norbert Nemec (5/9) Mar 05 2005 Even though this is supported by Python, it is considered very bad style...
I think it should be possible to import all modules stored in a specific package by one shot, like this: import std.c.*; // Imports all modules in package std.c
Mar 03 2005
denisw wrote:I think it should be possible to import all modules stored in a specific package by one shot, like this: import std.c.*; // Imports all modules in package std.cWe all do, but meanwhile there's a few workarounds: http://www.prowiki.org/wiki4d/wiki.cgi?BestPractice #ConventionalModuleNameforImportingAllModulesinaPackage But we can still hope that D gets Java-style * imports. --anders
Mar 03 2005
Typo:http://www.prowiki.org/wiki4d/wiki.cgi?BestPractice #ConventionalModuleNameforImportingAllModulesinaPackagehttp://www.prowiki.org/wiki4d/wiki.cgi?BestPractices #ConventionalModuleNameforImportingAllModulesinaPackage --anders
Mar 03 2005
In article <d07cof$nl$2 digitaldaemon.com>, =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= says...denisw wrote:I don't the issue is that Walter hasn't had time to add this feature. I think the issue is that Walter doesn't think it'd be a good idea to have this feature (the programmer might bring in modules that he didn't expect). FWIW, I think import * would create more trouble than it's worth. But we've already discussed this to death, so I'll leave it there. jcc7I think it should be possible to import all modules stored in a specific package by one shot, like this: import std.c.*; // Imports all modules in package std.cWe all do, but meanwhile there's a few workarounds: http://www.prowiki.org/wiki4d/wiki.cgi?BestPractice #ConventionalModuleNameforImportingAllModulesinaPackage But we can still hope that D gets Java-style * imports. --anders
Mar 03 2005
No bloody way! This is one Java's most specious pieces of utility. The only reason for it is laziness on the part of the (initial) programmer. The arguments against are legion: coupling, reduction in maintainability, intractable to automated dependency source analysis tools, etc. etc. "denisw" <denisw_member pathlink.com> wrote in message news:d07cf3$lv$1 digitaldaemon.com...I think it should be possible to import all modules stored in a specific package by one shot, like this: import std.c.*; // Imports all modules in package std.c
Mar 03 2005
denisw schrieb:I think it should be possible to import all modules stored in a specific package by one shot, like this: import std.c.*; // Imports all modules in package std.cEven though this is supported by Python, it is considered very bad style for serious projects. It is useful for quick-and-dirty programming or interactive work, but I don't think D is intended to be optimized for that in any way.
Mar 05 2005