19 May 1997
Here's the question again:
What is the one situation where a line may not end with a comment?
If a string is too long to fit on one line, it can be split by terminating all but the last line with '%', and starting all but the first line with '%' (possibly preceded by spaces). For example:
s := "A very very very %
%long string."
In this case, a comment may not follow the '%' at the end of the first line. Not even white space is permitted after it!
By way of contrast, the corresponding Delphi code is:
s := "A very very very " +
"long string."
Delphi's string catenation operator is evaluated at compile time. Some Eiffel implementations support infix "+" for STRINGs (it's not required by ELS95), but I don't know whether it's evaluated at compile time.
The Eiffel-like language Blue (http://www.cs.su.oz.au/~mik/blue/blue.html) allows multiple consecutive quoted strings, which are concatenated, e.g.
s := "A very very very "
"long string."
which seems a nice way to do it.
Eiffel and NICE are registered trademarks of the Nonprofit International Consortium for Eiffel.