🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #3314

Re: An ISO Standard Question

#3314
From: Graham Perkins
Date: Tue, 27 Feb 1996 19:11
29 lines
1590 bytes
gstark@ifs.org.uk wrote:
>.. one of two "ISO Compliant" compilers we've tested (XDS), this is legal:
> VAR
>   s : StrArr;
> BEGIN
>   s := StrArr{"Hello" , "Mum" };
> 
> ... but this is *illegal*:
> 
> TYPE
>   Str = ARRAY[1 .. 10] OF CHAR;
>   StrArr = ARRAY[1 .. 2] OF Str;
> CONST
>   s = StrArr{"Hello" , "Mum"};
> 
> However this structured constant *is* allowed under GPM2,

I've got Fourth Draft of the ISO standard, which I believe was quite close to
the final.  It clearly states that the value given for a named constant in a 
constant declaration must be a constant expression.  It is also states that an
array constructor is a constant expression if its contents are constant expressions.
My understanding of that is that one could construct arbitrarily nested array/record
structures, so long as "leaf" items were constant values.

-- 
person: Graham Perkins         paper: School of Computing
voice:  +44 (0)1908 834936            De Montfort University
dots:   +44 (0)1908 834948            Milton Keynes MK7 6HP
bits:   grp@dmu.ac.uk                 United Kingdom
Technical Details
Message-ID: <3133574C.2962@dmu.ac.uk>
Path: arc1-ca.pugleaf.net!yama.mcc.ac.uk!dmu!usenet
References: <1996Feb27.135653.53493@ucl.ac.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!yama.mcc.ac.uk!dmu!usenet
From: Graham Perkins <grp@dmu.ac.uk>
Newsgroups: comp.lang.modula2
Subject: Re: An ISO Standard Question
Date: Tue, 27 Feb 1996 19:11:08 +0000
Organization: De Montfort University
Message-ID: <3133574C.2962@dmu.ac.uk>
References: <1996Feb27.135653.53493@ucl.ac.uk>
NNTP-Posting-Host: mkcsst22.mk.dmu.ac.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.0 (Win16; I)