I like self documenting code.
The import procs are nothing but self-documenting, see for eg lib/posix/posix.nim:
proc fmtmsg*(a1: int, a2: cstring, a3: cint,
a4, a5, a6: cstring): cint {.importc, header: "<fmtmsg.h>".}
(many such examples)
why not use instead the native argument names where the proc is defined, eg: from https://linux.die.net/man/3/fmtmsg
int fmtmsg(long classification, const char *label,
int severity, const char *text,
const char *action, const char *tag);
so we'd have:
proc fmtmsg*(classification: int, label: cstring, severity: cint,
text, action, tag: cstring): cint {.importc, header: "<fmtmsg.h>".}
this is especially important when named arguments are being used.
How about:
I'm all for this but to be fair, C2nim just uses the names present in the translated header file if any.
In this case, there was no named arguments
int fmtmsg(long, const char *, int, const char *, const char *, const char *);
There are also several libraries where the names are poor single letter variables. I.e. if upstream doesn't properly name their own parameters, c2nim can do anything.
proc f (p: proc(int):int): void = ...
proc f(typedesc[int]): void = ....