gm2
[Top][All Lists]
Advanced

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

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


From: Fischlin Andreas
Subject: [Gm2] Fwd: CASE: gm2-4.1.2 of 2011-11-08 bug (or possibly philosophical difference)
Date: Fri, 11 Nov 2011 11:10:40 +0000


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<http://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!
________________________________________________________________________



Begin forwarded message:

Date: 11/Nov/2011 12:10:12 GMT+01:00
To: john o goyo <address@hidden<mailto:address@hidden>>
Subject: Re: [Gm2] CASE: gm2-4.1.2 of 2011-11-08 bug (or possibly philosophical 
difference)

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.

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


_______________________________________________
gm2 mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/gm2





reply via email to

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