Project

General

Profile

Support #915

When is a semicolon needed to end a statement/command?

Added by John Abbott over 7 years ago. Updated about 2 months ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
Parser/Interpreter
Target version:
Start date:
20 Aug 2016
Due date:
% Done:

0%

Estimated time:
Spent time:

Description

Some commands do not need a semicolon to make them happen.

if 1 > 0 then println "bigger" endif

The line above will execute even though there is no semicolon! Is this a bug or a feature?

I can understand that the ending semicolon is necessary in commands whose last part is an expression.

It is not clear to me why a semicolon is needed after ciao, continue and break (and maybe some others too).

History

#1 Updated by John Abbott over 7 years ago

This question came to me as I was writing the tutorials for CoCoA-5. I actually thought that the final semicolon was obligatory except for manual searches. I did know that the semicolon could be skipped inside some compound statements (e.g. if...then...endif).

#2 Updated by John Abbott about 2 months ago

  • Priority changed from Normal to Low

It'd be nice if there were a clean answer to this question, but it is also quite unimportant.
I don't recall ever having had a problem related to this.
Shall we just close or reject?

Also available in: Atom PDF