Re: Callbacks in the abstact data types and extra contextual data

2020-07-10 Thread Bruno Haible
Marc Nieper-Wißkirchen wrote: > For GCC one can use nested functions, but how can > 'partial_function_last' be implemented in ISO C? It can be implemented for each CPU type and ABI. But this is OK since the number of CPU types are hardly increasing nowadays. It cannot be implemented in ISO C. >

Re: Callbacks in the abstact data types and extra contextual data

2020-07-10 Thread Marc Nieper-Wißkirchen
Hi Bruno, Am Fr., 10. Juli 2020 um 20:38 Uhr schrieb Bruno Haible : > OK. Then let's take the problem seriously. If your solution can be implemented portable, that will be the best solution by far. For GCC one can use nested functions, but how can 'partial_function_last' be implemented in ISO

Re: Callbacks in the abstact data types and extra contextual data

2020-07-10 Thread Bruno Haible
Hi Marc, > > > a number of modules (like the hash module or the list module) allow > > > the user to specify callbacks (e.g. a comparison function). > > > Unfortunately, these procedures do not take a context parameter, which > > > can be a problem because C lacks closures. > > > > Is this a

Re: Callbacks in the abstact data types and extra contextual data

2020-07-09 Thread Marc Nieper-Wißkirchen
Hi Bruno, Am Do., 9. Juli 2020 um 22:16 Uhr schrieb Bruno Haible : > > a number of modules (like the hash module or the list module) allow > > the user to specify callbacks (e.g. a comparison function). > > Unfortunately, these procedures do not take a context parameter, which > > can be a

Re: Callbacks in the abstact data types and extra contextual data

2020-07-09 Thread Bruno Haible
Hi Marc, > a number of modules (like the hash module or the list module) allow > the user to specify callbacks (e.g. a comparison function). > Unfortunately, these procedures do not take a context parameter, which > can be a problem because C lacks closures. Is this a practical, actual problem,

Callbacks in the abstact data types and extra contextual data

2020-07-09 Thread Marc Nieper-Wißkirchen
Hi, a number of modules (like the hash module or the list module) allow the user to specify callbacks (e.g. a comparison function). Unfortunately, these procedures do not take a context parameter, which can be a problem because C lacks closures. The original qsort function in stdlib.h has the