Since a compilation is required before launching a dart application, i wonder if compiler preprocessor is available, or is scheduled in a near future for Dart.
My searches on the net / inside the dart site have proven unsuccessful so far.
( By preprocessor, i mean something like :
#define max(A,B) ( (A) > (B) ? (A):(B))
or :
#define NumType double
#define NumTypeZero 0.0
// used with :
NumType myNum = NumTypeZero;
or :
#define DEBUG
// use
#ifdef DEBUG
print('var1 : $var1, var2:$var2, ...');
#endif
)
Edit : I wonder why there's not allready a pre-processor because it seems we are 'near' from that point :
- Dart has to scan the files for library dependencies to load the libraries in the right order.
- Dart editor also scan files for syntax, type checking and other checks.
- It's possible to have some automated file processing launched within the editor (i couldn't find a valuable link for this, please let me know if you have one).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…