marcIhm / yabasic

Yabasic - A simple Basic interpreter for Unix and Windows
http://www.yabasic.de
MIT License
90 stars 17 forks source link

Suggestion: conditional `do .. loop` #27

Closed programandala-net closed 2 weeks ago

programandala-net commented 5 years ago

I had some problems compiling previous versions of Yabasic on ARM (Raspbian OS), but I have compiled and installed 2.82.1 on Intel (Debian OS). So now I can resume a couple of Yabasic projects.

Meanwhile, a have small suggestion for a future version: conditional do ... loop, e.g. do while .. loop, do until ... loop, do ... loop until and do ... loop while. This control flow structure is supported by Freebasic and other BASICs, beside the other traditional loops.

In my opinion, an advantage of a versatile do ... loop is the code is more "regular" and a bit easier to modify, instead of having to use do ... loop, repeat ... until and while ... wend, one for every case.

I don't remember a BASIC that supports conditions at both sides of a do ... loop, e.g. do while ... loop until, do until ...loop while, but it would be useful too, to save some code.

marcIhm commented 5 years ago

Thanx for this idea; however, currently I do not see much use in adding more syntax.

marcIhm commented 2 weeks ago

Sorry for my somewhat harsh comment, but I had no other opinion in this direction, so I close the issue.