[Pyrex] Pyrex at Pycon

Michael JasonSmith mpj17 at student.canterbury.ac.nz
Tue Mar 30 01:43:30 CEST 2004


On Mon, 2004-03-29 at 18:33, Greg Ewing wrote:
> > Which declarations do you think would defy automatic translation?
> 
> Preprocessor macros, mainly, because they're used for many different
> purposes that need to be handled very differently, but it's not always
> obvious which is which.
As a person who has to teach C, I would be happy to see the preprocessor
doused in petrol, thrown into the middle of the road and set on fire. 
It causes more confusion than it is worth :)

You could do a lot of automatic translation if you stuck to the C-99
standard; the translation of C enums, structs, and functions to Pyrex is
fairly mechanical, and my guide [1] tries to emphasise this.  I say
C-99, rather than the older ANSI (C-89, ISO) standard, because C-99 has
inline functions and variant-arrays that get rid of the two biggest uses
of #define.

I am the sort of person who would refuse support of #define on
principal.  Developers *should* be using C-99 because it allows them to
write better C, let alone helping out every one else.  In C, types are
good!

[1] http://ldots.org/pyrex-guide/
-- 
Michael JasonSmith                                   http://www.ldots.org/





More information about the Pyrex mailing list