>
>
> Op Tue, 5 May 2009, schreef Michael V. Denisenko:
>
>> A question appeared when I tried to find a method of generating
>> case-expression just once, not for every comparison. Is it optimal to
>> try to add for every case-structure (and do...while, by the way) a
>> temporary variable where we may hold the value of case-expression?
>
> Yes, but it only if the variable part of the case expression is complex,
> i.e. not a simple loadn or perhaps subscriptn of a simple loadn.

In pstatmnt.pas _with_statement() function there is code that also already 
provides the same
functionality for the with statement. This code can be generalized and reused.

Peter

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to