Waldek Hebisch wrote:
Peter N Lewis wroteL
You might want to consider writing wrapper routines (that accept string values and pass references).
Ignoring Adriaan's misplaced sarcasm, it is not practical to write wrappers for interface functions like this. Interface functions are by definition interfaces on to existing routines, and have no code associated with them (even the initialization code required by GPC causes us problems). Not upgrading GPC would be a preferable solution to writing wrappers around all these routines with all the code changes and implementation code issues that would require.
Could you elaborate what problems wrappers cause? I can see that generating wrappers takes some effort and they cause some space and time overhead at runtime. So I would avoid needless wrappers. But I would say: if you need them, them use them.
Despite the claims in GPC to the contrary, "const" array parameters must be passed by reference according to the ABI anyway, and there is no way for the compiler to optimize it out since in these cases it can never have any access to the code behind the declaration since it is in the system.
I would be not so religious about ABI. Apple ABI seem to expose many low-level details without real need. My impression is that this is already causing them serious compatibilty problems. Wrappers allow to isolate Pascal programs at least from some low level details.
I agree completely to both points. Both things can help make using the interfaces (i.e., Pascal programming) more comfortable, and unless the call overhead is of superior importance, I'd prefer the comfort. (I can imagine that there are a few cases where efficiency matters. In these cases, you'd still need hand-written conversions in place, but for the same reason, you usually want to avoid anything implicit and write everything explicit to have full control. In a few places, this might be acceptable ...) Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE D101 CD02 4C9D 0FE0 E5E8