C's syntax (was Re: Python Formatted C Converter (PfCC))

Erik Max Francis max at alcyone.com
Fri Oct 27 01:02:55 EDT 2000


William Tanksley wrote:

> For example, it's generally conceded that realloc has too many
> functions:
> it does downsizing, allocation, and upsizing.  At least one of those
> functions (preferably allocation) should be removed.

Not true at all.  There are frequent cases when realloc's complete
generality simplifies things a great deal.  Implementing dynamically
resizing arrays (which is what realloc is for) is a great deal more
straightforward if you don't have to special case allocation and
freeing.

In fact, with realloc, you don't need to use malloc and free at all.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ The most exhausting thing in life is being insincere.
\__/ Anne Morrow Lindbergh
    Esperanto reference / http://mirror/alcyone/max/lang/esperanto/
 An Esperanto reference for English speakers.



More information about the Python-list mailing list