gm2
[Top][All Lists]
Advanced

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

Re: [Gm2] Returning a string constant


From: Gaius Mulley
Subject: Re: [Gm2] Returning a string constant
Date: 27 Oct 2008 20:52:24 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

"Breeden, Thomas (tmb)" <address@hidden> writes:

> Hi all,
> 
> Actually, in ISO Standard Modula-2, it is legal.
> 
> One of the changes made from Wirth's definition of the language is that 
> functions can
> return structured types.
> 
> I tried the test program out in my copy of the late, lamented, Stony Brook 
> compiler and
> it compiled and ran perfectly.
> 
> I'm pretty much in sympathy with all the arguments against, but I feel that 
> it would be
> better for M2 if GM2 did implement the ISO standard.
> 
> regards
> 
> Tom
> address@hidden
> 
> See:
> 
>    ISO/IEC 10514-1, the standard for Modula-2: changes, clarifications and 
> additions
>    Source       ACM SIGPLAN Notices archive
>    Volume 31 ,  Issue 8  (August 1996)
>    Pages: 84 - 95
>    Year of Publication: 1996
>    ISSN:0362-1340
>    Authors
>       M. Schönhacker     Vienna University of Technology, Austria
>       C. Pronk   Delft University of Technology, The Netherlands
>    Publisher
>       ACM  New York, NY, USA

Hi,

now fixed in the CVS.  GNU Modula-2 allows formal parameters to be
specified as:

FormalParameters := '(' [ MultiFPSection  ] ')' [ ':' Qualident  ] 
                  =: 

which is (after the ":") the same as PIM2 p148 line 80,
PIM3 p172 line 76, PIM4 p158 line 80 and ISO p641 C.2.4.2.

Many thanks for the bug report - it did work if a temporary
variable was used, such as:

PROCEDURE test () : string ;
VAR
   t: string ;
BEGIN
   t := "test" ;
   RETURN t
END test ;

but it should have worked without the need for this temporary..

regards,
Gaius




reply via email to

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