gm2
[Top][All Lists]
Advanced

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

Re: [Gm2] Fwd: CASE: gm2-4.1.2 of 2011-11-08 bug (or possibly philosophi


From: john o goyo
Subject: Re: [Gm2] Fwd: CASE: gm2-4.1.2 of 2011-11-08 bug (or possibly philosophical difference)
Date: Fri, 11 Nov 2011 09:38:16 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110921 Thunderbird/3.1.15

Sorry, but I do not quite get what you mean by missing value. Do you mean that 
one item of Choice,
> i.e. weight, is not used by the CASE record? If yes, then it is clear to me what gm2 should do, not
>  enforce that all values are covered if PIM is specified. E.g.

ItemType = RECORD CASE : INTEGER OF
1: ....
2: ....
     END(*CASE*); END(*RECORD*)

should be allowed and the compiler must not require to list all integer 
numbers. Similarly when
> Choice enumerates a finite set of cases the compiler must not require to list all elements
> of the enumeration type.


This is precisely what I meant.  My apologies for being so obscure.

john


Regards,
Andreas


ETH Zurich
Prof. Dr. Andreas Fischlin
Systems Ecology - Institute of Integrative Biology
CHN E 21.1
Universitaetstrasse 16
8092 Zurich
SWITZERLAND

address@hidden<mailto:address@hidden>
www.sysecol.ethz.ch

+41 44 633-6090 phone
+41 44 633-1136 fax
+41 79 221-4657 mobile

             Make it as simple as possible, but distrust it!
________________________________________________________________________



On 10/11/2011, at 22:43 , john o goyo wrote:

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.
==============================



reply via email to

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