From: AeroSpace Ed on 25 Oct 2006 09:27 Tobias Schlemmer wrote: > AeroSpace Ed schrieb: >> Elijah Cardon wrote: >> >>> One of the reasons that I use #define in c is that it mimics what might >>> happen if a caller were passing what is being #defined. Is there such a >>> thing as a preprocessor in fortran? EC > >> This doesn't make any sense to me. What EXACTLY are you using the >> #defined >> directive for? Many Fortran compilers can pre-process cpp statements. > > One interesteing application of #define is IMHO the C/C++ macro assert, > which assures a given expression. In the failure case it will stop your > program and output the current filename and line number together with > the test to stderr. > > One problem I have with g95: > The macro expansion very often exeeds the > >> However, your described use doesn't make any sense to me. > Using autoconf is a very useful example. > > or e. g. > > #ifdef DEBUG > #define pure > #endif > > That enables you to have some debug output in otherwise pure functions > if you are familiar with the side effects. > > Tobias I'm not sure this explains to me how Elijah is using #define. Ed
First
|
Prev
|
Pages: 1 2 Prev: ABSOFT FORTRAN v10 COMPILER Next: Bus error/ segmentation fault--help? |