Need Preprocessor Module!
Pierre Imbaud
pierre at saiph.com
Tue Jan 25 19:10:23 EST 2000
Akinori Tsuchida wrote:
>
> I would like to use preprocessor-like functionality in Python
> like we use in C/C++.
>
> Many corresponding functionalities are available in Python, but
> I think preprocessor is still useful.
>
> For example, you can comment multiple lines just by "if 0" and "endif"
> with no need to consider indenting.
> You don't have to take care of not embracing another comment section, I
> mean...
>
> #if 0
> #if 0
> not required part.
> #endif
> #endif
>
> Above is treated as expected but
>
> """
> """
> not required part.
> """
> """
> not the case with above. (unwanted part still remains.)
>
> Well, Any module available ?
> like,... input strings containing preprocessor lines
> and then output processed strings.
>
> #ifdef YOU_KNOW
> #include INFO
> Please_Answer(INFO)
> #endif
>
> Thanks for reading this article.
>
> Akinori Tsuchida.
Well, m4, available on any unix platform, can do what you ask for, and
more.
But you should think twice: adding a layer always mean adding trouble,
source of bugs, loss of readability...
somehow, think of python as of risc processors: give up some fancy
possibilities,
keep a basic set that lets U do everything, and U will be rewarded for
choosing
simplicity
--
Pierre Imbaud <pierre at saiph.com>
12 Rue des Bosquets 91480 Quincy Sous Sénart France
Tel: 01 69 00 94 57 Fax 79 65
More information about the Python-list
mailing list