rfc:loop_default

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:loop_default [2014/09/19 11:04] leighrfc:loop_default [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 43: Line 43:
 In the case of ''for'' and ''foreach'' loops it's immediately obvious that separate tracking variables would be required to monitor whether the loop had been entered. This proposal does away with that necessity and increases performance as a side-effect. In the case of ''for'' and ''foreach'' loops it's immediately obvious that separate tracking variables would be required to monitor whether the loop had been entered. This proposal does away with that necessity and increases performance as a side-effect.
  
-''do {} wile();'' loops have been deliberately excluded from this behaviour as they always enter the loop at least once. The only available behaviour for a ''default'' block on a do while loop is to have it execute if the loop only iterates once, which feels inconsistent.+''do {} while();'' loops have been deliberately excluded from this behaviour as they always enter the loop at least once. The only available behaviour for a ''default'' block on a do while loop is to have it execute if the loop only iterates once, which feels inconsistent.
  
 Alternate syntax loops also gain this functionality with a ''default:'' clause that does not break ''switch'' statements. Alternate syntax loops also gain this functionality with a ''default:'' clause that does not break ''switch'' statements.
rfc/loop_default.1411124685.txt.gz · Last modified: 2017/09/22 13:28 (external edit)