[Pyrex] Just some thoughts

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Apr 19 05:30:34 CEST 2006


Tomasz Primke wrote:

> it would be better (and easier, faster, more convenient) to write just:
> 
> for i from lower_bound <= upper_bound:

Actually, I'm thinking of changing it to

   for lower_bound <= i < upper_bound:

Your version wouldn't work, because it doesn't have the
freedom to specify < or <= independently for the lower
and upper bounds.

>   a) Why on Earth the name of the loop variable should be written twice?

I agree, which is why I'm considering the above change.
The current syntax came out of an old discussion about
adding something similar to Python, which never came to
anything. Originally I had wanted what I wrote above,
but some people didn't like it, and the current Pyrex
syntax emerged as a compromise. Now I feel my original
instinct was correct.

> 2) I think that Pyrex should offer some low-level memory managment routines. 

I have some ideas for that, too.

> 3) It would be great to have some easy way to auto-create Python wrappers 
> for chosen C functions and/or methods.

That's a reasonable idea, although I'll have to think
about the implementation.

Thanks for your comments,
--
Greg




More information about the Pyrex mailing list