LINUX.ORG.RU

История изменений

Исправление korvin_, (текущая версия) :

-- precondition loops:

while <condition> do
	<statement>;
	...
done:while;

until <condition> do
	<statement>;
	...
done:until;



-- postcondition loops:

repeat
	<statement>;
	...
loop:while condition;

repeat
	<statement>;
	...
loop:until condition;



-- infinite loop:

repeat
	<statement>;
	...
loop:forever;



-- code block:

do
	<statement>;
	...
done;



-- bonus:

repeat
	<statement>;
	...
loop:never;

Если извращение с loop:never не нужно, то для бесконечного цикла достаточно

repeat
	<statement>;
	...
loop;

Исправление korvin_, :

-- precondition loops:

while <condition> do
	<statement>;
	...
done:while;

until <condition> do
	<statement>;
	...
done:until;



-- postcondition loops:

repeat
	<statement>;
	...
loop:while condition;

repeat
	<statement>;
	...
loop:until condition;



-- infinite loop:

repeat
	<statement>;
	...
loop:forever;



-- code block:

do
	<statement>;
	...
done;



-- bonus:

repeat
	<statement>;
	...
loop:never;

Исходная версия korvin_, :

-- precondition loops:

while <condition> do
	<statement>;
	...
done:while;

until <condition> do
	<statement>;
	...
done:until;



-- postcondition loops:

repeat
	<statement>;
	...
loop:while condition;

repeat
	<statement>;
	...
loop:until condition;



-- infinite loop:

repeat
	<statement>;
	...
loop:forever;



-- code block:

do
	<statement>;
	...
done;