[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Callbacks in the abstact data types and extra contextual data
From: |
Marc Nieper-Wißkirchen |
Subject: |
Callbacks in the abstact data types and extra contextual data |
Date: |
Thu, 9 Jul 2020 18:13:02 +0200 |
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 same problem. Glibs
has remedied the problem by introducing qsort_r.
It would be nice if the modules hash, list, xlist, oset, xoset, ...
are extended in a similar way. We would essentially need new
constructors, say with the '_r' suffix.
Marc
- Callbacks in the abstact data types and extra contextual data,
Marc Nieper-Wißkirchen <=