Barry_Cornelius@DURHAM.MAILNET (06/17/86)
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".