From c99ec1654452eede8b374eb85cb05b2e759be23f Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 2 Oct 2014 10:08:41 +0200 Subject: deprecated string case statements without 'else' --- doc/manual/stmts.txt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'doc/manual') diff --git a/doc/manual/stmts.txt b/doc/manual/stmts.txt index b706101e1..1307ff917 100644 --- a/doc/manual/stmts.txt +++ b/doc/manual/stmts.txt @@ -262,13 +262,11 @@ given *slicelist* the ``else`` part is executed. If there is no ``else`` part and not all possible values that ``expr`` can hold occur in a ``slicelist``, a static error occurs. This holds only for expressions of ordinal types. "All possible values" of ``expr`` are determined by ``expr``'s -type. +type. To suppress the static error an ``else`` part with an +empty ``discard`` statement should be used. -If the expression is not of an ordinal type, and no ``else`` part is -given, control passes after the ``case`` statement. - -To suppress the static error in the ordinal case an ``else`` part with an -empty ``discard`` statement can be used. +For non ordinal types it is not possible to list every possible value and so +these always require an ``else`` part. As a special semantic extension, an expression in an ``of`` branch of a case statement may evaluate to a set or array constructor; the set or array is then -- cgit 1.4.1-2-gfad0