[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] CASE: gm2-4.1.2 of 2011-11-08 bug (or possibly philosophical d
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] CASE: gm2-4.1.2 of 2011-11-08 bug (or possibly philosophical difference) |
Date: |
Fri, 11 Nov 2011 17:58:27 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
john o goyo <address@hidden> writes:
> As we all know, PIM allows missing values in CASE statements but ISO
> does not. At present, gm2 enforces the ISO restriction regardless of
> which PIM is specified. (A simple example may be found below.)
>
> What should gm2 do? (The problem arises, of course, in compiling
> existing code.)
>
> john
>
> ==============================
> MODULE Test;
>
> TYPE
> Choice = (colour, size, weight);
> ItemType = RECORD
> CASE c :Choice OF
> colour: col :CHAR;
> |size: s :CARDINAL;
> (*
> * PIM allows missing values but ISO does not.
> *)
> END (*CASE*);
> END (*ItemType*);
>
> VAR
> item :ItemType;
>
> BEGIN
> item.col := 'R';
> END Test.
> ==============================
Hi John,
thanks for the bug report - indeed gm2 should not insist of each value
specified inside the variant record (for pim). I'll relax the checking
for -fpim and friends. I think it might be useful to introduce a new
option to switch this checking on/off then we get the best of both (if
desired),
regards,
Gaius