Loop controls: break and continue

My experience is no proof, but I didn’t see any real need of goto so far. That is in languages which have proper break and continue. Thus Skila does not have goto, but have rich break and continue. Don’t mind the syntax, I am not sure about it:

label ext_loop
while true do
    break ext_loop;
  until false;

In this dummy example program immediately jumps out of those two loops, once it hits first break.

Note: you can label only loops.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: