Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!DURHAM.MAILNET!Barry_Cornelius From: Barry_Cornelius@DURHAM.MAILNET Newsgroups: net.lang.mod2 Subject: Functions Returning Results of Any Type Message-ID: <89739@DURHAM.MAILNET> Date: Tue, 17-Jun-86 12:38:34 EDT Article-I.D.: DURHAM.89739 Posted: Tue Jun 17 12:38:34 1986 Date-Received: Fri, 20-Jun-86 02:55:24 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 24 Bruce Bergman asks whether functions may return results of any type or whether they have to return results which are unstructured. Page 52 of the 2nd edition of "Programming in Modula-2" mentions (twice) that the result of a function procedure cannot be structured. However, I understand that Wirth has stated that: The restriction on function result types in the User Manual was an implementation restriction of our compilers. The language itself has no restriction. I understand that this dates from either 11Sep83 or 13Oct83. There is nothing about this subject in the Report (in either the 2nd or 3rd edition). The current position of the Modula-2 Working Group of the British Standards Institution is summarised by the following decision: WG061: It was agreed that a function procedure may return a value of any type. Wirth has said that the restriction on function result types in PIM was an implementation restriction of his compilers: the language itself has no restriction. The following decision may also be of interest: WG073: Although a function procedure may return a value which is of a PROCEDURE, POINTER, RECORD or ARRAY type (see WG061) it was agreed that these results cannot be "applied", "dereferenced", "selected" or "indexed".