>>>>> "Paul" == Paul Marquess <pmarquess@bfsec.bt.co.uk> writes:
>> > So... what do you think about the idea of having a ppp? I
>> *might* be > prepared to give this a go, *if* there is enough
>> interest. > Yes please. Certainly doing #define's, #if's and
>> #ifdef's should be straightforward. Doing macro substitutions with
>> parameters might be a little more tricky!
Paul> *If* I do it, it would only be #if #elsif #else #endif #define
Paul> and #undef. I wouldn't even attempt macros with parameters.
>> But why do it in perl? Why not find a public domain CPP and
>> include that? Much less effort and faster too.
I spent a few hours thinking about ppp, and it turns out things are
not really easy. Main problem: what should a "ppp" really do ?
1. If it is cpp-like, where should substitutions occur?
Say, I define
#define PI 3.141592653589793
Simple: $pi=PI;
Harder: $PI=PI;
Harder: print "The value of PI is $pi";
If you decided that, next is:
print <<EOT;
The value of PI is $PI
EOT
And then @constants=qw( E PI GAMMA );
I am not even decided what *I* presume should happen in these cases.
A PD cpp would have to be tuned up quite a bit, I fear.
--
Jost Krieger, Rechenzentrum der Ruhr-Universitaet Bochum
Jost.Krieger@rz.ruhr-uni-bochum.de
C=de;AD=d400;PD=ruhr-uni-bochum;OU=rz;OU=ruba;S=Krieger;G=Jost;
>> > So... what do you think about the idea of having a ppp? I
>> *might* be > prepared to give this a go, *if* there is enough
>> interest. > Yes please. Certainly doing #define's, #if's and
>> #ifdef's should be straightforward. Doing macro substitutions with
>> parameters might be a little more tricky!
Paul> *If* I do it, it would only be #if #elsif #else #endif #define
Paul> and #undef. I wouldn't even attempt macros with parameters.
>> But why do it in perl? Why not find a public domain CPP and
>> include that? Much less effort and faster too.
I spent a few hours thinking about ppp, and it turns out things are
not really easy. Main problem: what should a "ppp" really do ?
1. If it is cpp-like, where should substitutions occur?
Say, I define
#define PI 3.141592653589793
Simple: $pi=PI;
Harder: $PI=PI;
Harder: print "The value of PI is $pi";
If you decided that, next is:
print <<EOT;
The value of PI is $PI
EOT
And then @constants=qw( E PI GAMMA );
I am not even decided what *I* presume should happen in these cases.
A PD cpp would have to be tuned up quite a bit, I fear.
--
Jost Krieger, Rechenzentrum der Ruhr-Universitaet Bochum
Jost.Krieger@rz.ruhr-uni-bochum.de
C=de;AD=d400;PD=ruhr-uni-bochum;OU=rz;OU=ruba;S=Krieger;G=Jost;