Semicolons - Spicery/Nutmeg GitHub Wiki

Semicolons are used in Nutmeg to separate individual statements in a statement-sequence. Anywhere that a statement can occur, you can use multiple statements without any additional syntax. Statement-sequences are a signature feature of Nutmeg that eliminate the need for the distracting { STMNT; ... } compound-statement brackets that languages like Java, Javascript, C/++/# suffer from. Nutmeg can do this because it has paired opening-and-closing keywords that safely bracket the context. Consequently there is no need for extra brackets.

Here's some places where statement-sequences appear in Nutmeg, where E stands for expression and S for a statement sequence.

### Conditionals
if E then S elseif E then S else S endif

### Loops
for i in E do S endfor

### Definitions
def f(x): S enddef

As an alternative to semi-colons, statements can also be separated by line breaks. The way this works is that a statement-sequence turns on newline-termination from the start to the end of the statement-sequence. This means that a line-break will act exactly like a semi-colon and end the current statement. So in reality the only time you need to use semi-colons is when you put multiple statements on one line, which would be quite unusual e.g.

var x := y; x <- x + 1; y <- y - 1;   ### All on one line

However, any expression brackets (e.g. ( ... ), if ... endif, for ... endfor) will turn it off newline-termination between the brackets. So expressions can be written across multiple lines without any difficulty.