Programming-Idioms

History of Idiom 78 > diff from v25 to v26

Edit summary for version 26 :

Version 25

2015-09-05, 13:20:42

Version 26

2015-09-05, 13:22:54

Idiom #78 "do while" loop

Execute a block once, then execute it again as long as boolean condition c is true.

Idiom #78 "do while" loop

Execute a block once, then execute it again as long as boolean condition c is true.

Code
do_while c b = do
      a <- b
      if c a then do_while c b else return a

do_while (=="") getLine
Code
do_while c b = do
      a <- b
      if c a
      then do_while c b
      else return a

do_while (=="") getLine