Logo

Programming-Idioms

History of Idiom 78 > diff from v21 to v22

Edit summary for version 22 by :

Version 21

2015-09-05, 13:19:00

Version 22

2015-09-05, 13:19:51

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
doWhile c b = do a <- b; if c a then doWhile c b else return a

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

do_while (=="") getLine