D calling convention

Walter Bright newshound1 at digitalmars.com
Tue Oct 28 12:23:28 PDT 2008


Christian Kamm wrote:
> One point we couldn't understand though, is the reversal of parameters when
> calling some D functions: Parameters are usually passed right-to-left,
> except for nonvariadic D functions, where the order changes to
> left-to-right. 
> 
> What is the reason for it?

The reason is because I'd eventually like to specify the order of 
evaluation of function arguments as being left to right. So, for normal 
D functions, this makes for optimal code generation. The only time 
monkey business would have to happen would be to support the C calling 
convention or the variadic one.



More information about the Digitalmars-d mailing list