Very interesting question [WayBack] delphi – IfThen(Assigned(Widget), Widget.Description, ‘No Widget’) doesn’t crash. Should it? – Stack Overflow.
Three important things here:
- depending on inlining and kind of arguments, function calls can evaluate their arguments one or multiple times
- lacking formal language specification, you never know if a method will be inlined or not
- function calls should not have side effects
Via another interesting discussion at [WayBack] Inline functions are not guaranteed to evaluate their arguments exactly once… – David Heffernan – Google+
–jeroen