Question about function aliases

bearophile bearophileHUGS at lycos.com
Thu Dec 12 03:11:54 PST 2013


Gary Willoughby:

> alias void function(ClientData clientData, Tcl_Interp* interp)  
> Tcl_InterpDeleteProc;
>
> extern (C) void Tcl_CallWhenDeleted(Tcl_Interp* interp, 
> Tcl_InterpDeleteProc proc, ClientData clientData);

With recent D compilers I prefer the alias with "=" and a more
aligned colums formatting of the arguments when they don't fit
well in a line:


alias Tcl_InterpDeleteProc = void function(ClientData clientData,
Tcl_Interp* interp);

extern(C) void Tcl_CallWhenDeleted(Tcl_Interp* interp,
                                     Tcl_InterpDeleteProc proc,
                                     ClientData clientData);

Also, can't you add some "const" in those arguments? Is your C
function pure? It should be nothrow.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list