Path: utzoo!attcan!uunet!husc6!bbn!uwmcsd1!ig!agate!ucbvax!ucdavis!iris!windley
From: windley@iris.ucdavis.edu (Phil Windley)
Newsgroups: comp.lang.pascal
Subject: Re: Multiple function-values (was: Re: The gaping hole left by var parameters ...)
Message-ID: <2120@ucdavis.ucdavis.edu>
Date: 31 May 88 16:56:15 GMT
References: <5879@uwmcsd1.UUCP> <3499@omepd> <5915@uwmcsd1.UUCP> <3854@diku.dk> <347@buengc.BU.EDU>
Sender: uucp@ucdavis.ucdavis.edu
Reply-To: windley@iris.UUCP (Phil Windley)
Organization: U.C. Davis - College of Engineering
Lines: 25

In article <347@buengc.BU.EDU> art@buengc.bu.edu (A. R. Thompson) writes:
>Wrong.  The result of the function is the pointer, not the record.  The
>pointer is a single value of a simple type.  Actually, functions that have
>structured types as a result type are to become part of the new Pascal
>standard due out soon.  When?
>
>The Oregon Software Pascal compiler, which I use as the Encore Pascal-2
>compiler, does indeed allow structured types as the result types of
>functions.  I can attest that this is quite handy, and makes good logical
>sense to boot.
>

Berkeley Pascal (the one that comes with most BSD implementations of UNIX)
allows this as well.  It works great.  I teach an introductory CS class and
trying to teach good data abstraction would be difficult if it were not for
this.  Try writing a rational number package without being able to return
structured types from a function.  The best you can do is to simulate it
with pointers and there's no need for that extra complication.




Phil Windley                          |  windley@iris.ucdavis.edu
Robotics Research Lab                 |  ucbvax!ucdavis!iris!windley
University of California, Davis       |