Article View: comp.lang.modula2
Article #1987Structured return values (was: Two Oberon questions)
From: Ben Stuyts
Date: Tue, 16 Apr 1991 06:29
Date: Tue, 16 Apr 1991 06:29
42 lines
1332 bytes
1332 bytes
MS> Can function procedures in Oberon return structured values?
MS> In Modula-2 they cannot,
I think in Modula-2 this is implementation defined. I don't recall
that Wirth explicitely says something about this.
At least the Rowley modula-2 compiler allows you to return structured
values from procedures. Something like this is legal:
MODULE Ret;
TYPE
Rec = RECORD
a,b,c,d: REAL;
END;
Arr = ARRAY [0..10] OF LONGCARD;
PROCEDURE a(): Rec;
VAR b: Rec;
BEGIN
RETURN b;
END a;
PROCEDURE c(): Arr;
VAR b: Arr;
BEGIN
RETURN b;
END c;
BEGIN
END Ret.
Best regards,
Ben
--
uucp: uunet!m2xenix!puddle!2!281!202.6!Ben.Stuyts
Internet: Ben.Stuyts@p6.f202.n281.z2.fidonet.org
Technical Details
Message-ID:
<3354.280DED7F@puddle.fidonet.org>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!zaphod.mps.ohio-state.edu!rpi!batcomputer!cornell!uw-beaver!zephyr.ens.tek.com!tektronix!percy!m2xenix!puddle!p6.f202.n281.z2.fidonet.org!Ben.StuytsShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!zaphod.mps.ohio-state.edu!rpi!batcomputer!cornell!uw-beaver!zephyr.ens.tek.com!tektronix!percy!m2xenix!puddle!p6.f202.n281.z2.fidonet.org!Ben.Stuyts From: Ben.Stuyts@p6.f202.n281.z2.fidonet.org (Ben Stuyts) Newsgroups: comp.lang.modula2 Subject: Structured return values (was: Two Oberon questions) Message-ID: <3354.280DED7F@puddle.fidonet.org> Date: 16 Apr 91 06:29:28 GMT Sender: ufgate@puddle.fidonet.org (newsout1.26) Organization: FidoNet node 2:281/202.6 - ST Quick BBS Haarle, Haarlem Holland Lines: 42