Vexu / bog

Small, strongly typed, embeddable language.
MIT License
546 stars 15 forks source link

Loop with post-condition #1

Open data-man opened 4 years ago

data-man commented 4 years ago

https://en.wikipedia.org/wiki/Control_flow#Loops

I propose repeat/until as in Pacal & Lua.

The great project, thank you!

Vexu commented 4 years ago

I do think more different statements/control flow could be nice, but I'm not sure how useful repeat..until/do..while would be since I've never needed them.

data-man commented 4 years ago

Unfortunately, I have no convincing arguments. However, I'm sure that most developers use while (true) with break in those languages where there are no postconditional loops. However, these loops are useful in many cases. E.g.: rg "until " in freepascal/compiler or in freepascal/rtl give us a lot occurrences.