Please translate this easy snip of C++ to Python

bowman bowman at montana.com
Mon Feb 5 01:42:55 EST 2001


Thomas Wouters <thomas at xs4all.net> wrote in message
news:mailman.981327676.7786.python-list at python.org...
>
> Note how Python lacks a preprocessor and macros :) People occasionally
rally
> for a macro preprocessor, but usually not of the C type. Being fairly
> ignorant in languages featuring macros other than the C style, I can't
> really say what they *are* rallying for, but apparently there are sane
macro
> preprocessors in existance, somewhere :)

Other than C, my exposure has been to various macro assemblers. With some
creativity, it is possible to write your own language to the extent the
underlying asm never surfaces. In fact, it isn't uncommon in embedded work
for people to use macros to write code for a PIC or AVR device almost
completely in '51 syntax.

I personally am uncomfortable when a language allows one to create a private
dialect; FORTH and many of the functional languages come to mind. Factoring
a problem into functions is one thing, but I prefer to see the bare metal of
the language and well known library calls rather than essentially having to
learn yet another language someone has lovingly handcrafted (and generally
not documented).







More information about the Python-list mailing list