gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] question about variant records in ISO M2


From: Gaius Mulley
Subject: [Gm2] question about variant records in ISO M2
Date: Fri, 31 Jul 2009 12:21:25 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Hi,

I'm implementing compile time range checking of variant records and
I was wondering whether ISO M2 allows multiple variants in a record.

For example is the following legal?

TYPE
   foo = RECORD
            CASE c: CARDINAL OF

            1..2:  x: INTEGER |

            ELSE
            END ;
            CASE b: BOOLEAN OF

            TRUE:  y: CARDINAL |
            FALSE: z: BOOLEAN

            END
         END ;


if it is legal then what result should the compiler return if asked:

VAR
   r: FOO ;

   TSIZE(r, TRUE)

?

regards,
Gaius




reply via email to

[Prev in Thread] Current Thread [Next in Thread]