On Thu, 2007-09-13 at 17:08 +0300, Antti-Juhani Kaijanaho wrote:

> What's wrong is exactly that any extra parameters to the comparison
> function *has* to be in the global environment - you don't get to choose
> this.  This makes any code that uses qsort and bsearch nonreentrant (and
> thus thread-unsafe), not to mention the clunkiness it induces in the
> code.

This is, of course, correct.

But please remember that almost all modern code that uses callbacks and
function pointers use an extra parameter (often of type void *) to avoid
this.  GTK+ and Gnome do this /very/ well and are thus quite friendly to
both C and programming in the large.

I would myself of course prefer that local/nested procedures were a part
of the standard language but that's not how things are :/

(And real closures would be even better.  And a half-way decent type
system.  With inference.  And a pony.  And no Kaczynski twins.)

-Peter



_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to