octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: constant folding


From: John W. Eaton
Subject: Re: constant folding
Date: Fri, 13 Dec 2013 09:27:49 -0600
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.11) Gecko/20121123 Icedove/10.0.11

On 12/13/2013 07:55 AM, Rik wrote:

The coding pattern

while (1)
  ...
   if (condition)
     break
   endif
endwhile

is pretty common and uses constants in the conditional.

There should be no effect for that because "1" is already a constant value that can't be further reduced. In order to have any effect, the constant expression must involve an operator of some kind. I just looked at the parser again and constant folding only applies to binary and unary operators. My recollection was that there were more cases (matrix constants, for example), but if there ever were, it looks like those have already been removed. So I really think that this will have minimal impact.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]