eepjm@cc.newcastle.edu.au (04/15/91)
In article <1991Apr12.104304.4194@jyu.fi>, sakkinen@jyu.fi (Markku Sakkinen) writes: > ... > Second question: > Can function procedures in Oberon return structured values? > In Modula-2 they cannot, but in Modula-3 this defect has been corrected. > Again, the language definition carefully avoids saying anything > (which would imply "yes"), but neither is this mentioned as a difference > from Modula-2 (which would imply "no"). For some time now I have been telling my students that Modula-2 removed the rather pointless Pascal restriction on the type of a function result. I based this claim on two observations: (a) the M-2 compiler which I use does allow structured values to be returned; (b) Wirth's books on the subject avoid saying anything about it (which, as above, implies "yes"). Am I wrong? If so, to whom do I complain? Surely we don't have to go back to forcing M-2 programmers to memorise the totally artifical distinction between "structured" and "unstructured". Peter Moylan eepjm@cc.newcastle.edu.au P.S. (Totally different topic, but while I think of it .... Does the emerging Modula-2 standard say how to declare a structured constant? This is something which definitely needs standardising : most compiler writers recognise that there must be a facility to declare, for example, an array of constants, but so far this feature has not been portable.)
reid@CTC.CONTEL.COM (Tom Reid x4505) (04/15/91)
= For some time now I have been telling my students that Modula-2 removed the = rather pointless Pascal restriction on the type of a function result. I = based this claim on two observations: = (a) the M-2 compiler which I use does allow structured values to be = returned; = (b) Wirth's books on the subject avoid saying anything about it (which, as = above, implies "yes"). = Am I wrong? If so, to whom do I complain? Surely we don't have to go back = to forcing M-2 programmers to memorise the totally artifical distinction = between "structured" and "unstructured". = = Peter Moylan eepjm@cc.newcastle.edu.au = According to Wirth (Programming in Modula-2, 3rd Corrected Edition, p. 56): "2. The result of a function procedure cannot be structured." However, it is not a difficult extension and many compilers have added it (FST is at least one exception). Tom Reid reid@ctc.contel.com