0

I would like to create a do-while loop in Raptor like the one in the picture:

do-while loop

instead of the while loop typical of Raptor. I don't seem to be able to put any block between "Loop" node and condition node. Isn't it possible or am I missing something?

Raptor version is 4.1.0.0001

Notes:

  • I am perfectly aware that I can simulate any do while with a while (I think there's also a theorem demonstrating it)
  • I am not interested at all in workarounds
  • I'm a teacher and I would like my teenagers pupils to see concepts represented the same way they think, without having to use workarounds (I mean if most languages has both a while and a do-while there has to be a reason)
massi
  • 200
  • 9
  • While I'm not familiar with Raptor specifically, I will say that flowcharts don't really have a `do` or `while` loop - they're more like assembly-code in that you express it as an conditional jump back to a prior instruction. – Dai Apr 03 '22 at 10:52
  • I am not familiar with Raptor either, but `do{A} while {B}` is basically `while(true){ A; if (!B) break;}` – qrsngky Apr 03 '22 at 11:07
  • @qrsngky I edited my question to clarify. Anyway I do think that the use of break should be limited to situations in which is really (performance) needed, otherwise is the way of writing "bad" code. – massi Apr 03 '22 at 15:50
  • @massi Using `break` has _absolutely zero_ bearing on the performance of compiled code. – Dai Apr 03 '22 at 23:09

0 Answers0