From: jzakiya@... Date: 2017-02-19T01:29:47+00:00 Subject: [ruby-core:79601] [Ruby trunk Misc#13230] Better Do ... while structure Issue #13230 has been reported by Jabari Zakiya. ---------------------------------------- Misc #13230: Better Do ... while structure https://bugs.ruby-lang.org/issues/13230 * Author: Jabari Zakiya * Status: Open * Priority: Normal * Assignee: ---------------------------------------- I just saw this, and thought I'd pass it along. http://ncomputers.org/suggestions/do%20while.cpp ``` Do ... while structure improvement Sometimes the use of jumps such as: continue, break, goto, call to a function, etc. is necessary to avoid the execution of some instructions. This is the case of the seed, warp and swap loops of this solution for the n queens problem. To avoid the use of jumps or tricks like for(;;) if(condition)break; on some of these cases, we are suggesting the below improvement to the do ... while loop str /* author: ncomputers.org */ int main(){ // Allow initializers (extra improvement) do(bool condition=0){ // Block A }while(condition){ // Block B // Variables declared inside the initializer still visible } return 0; } ``` -- https://bugs.ruby-lang.org/ Unsubscribe: