Hiho,

as I am currently very insterested in compiler implementation I often look into the DMD github and look how things are done there. Often I find myself curious about things at first but find out the rational behind certain implementation decisions.

One thing I can't figure out is the different approach with pre- and postfix expressions. While prefix expressions inherit from UnaExp (unary expression) which makes sense to me as it is an expression with only one parameter (in general) the postfix inc and decrement expressions are inherited from BinExpr (binary expression) which define their second expression to be an integer expression with a value of 1.

So I am very curious about the rational behind this design decision. Why do Postfix expression not inherit from UnaExp, too? Am I missing something very important?

Thanks in advance! =)

I hope this is the right place to ask questions about the DMD compiler.

Regards,
Robin

Reply via email to