digitalmars.D.learn - writef()
- nascent (5/5) Feb 23 2006 I created a stack using a LinkedList. This worked, but when testing it I...
- Oskar Linde (6/13) Feb 23 2006 The order of evaluation is undefined. In this case, the ABI of your
I created a stack using a LinkedList. This worked, but when testing it I found using, writef("%s, %s, %s", stack.pop(), stack.pop(), stack.pop()); would present the stack as a fifo. I assume the results are because it is evaluating the arguments from right to left. Why?
Feb 23 2006
nascent wrote:I created a stack using a LinkedList. This worked, but when testing it I found using, writef("%s, %s, %s", stack.pop(), stack.pop(), stack.pop()); would present the stack as a fifo. I assume the results are because it is evaluating the arguments from right to left. Why?The order of evaluation is undefined. In this case, the ABI of your architecture says function arguments are pushed on the stack from the right to left. Therefore, it is also convenient for the compiler to evaluate them in that order. /Oskar
Feb 23 2006