On Mar 23, 2007, at 3:40 AM, M Pulis wrote: > > On Mar 22, 2007, at 11:31 PM, Guyren Howe wrote: > >> On Mar 22, 2007, at 11:52 PM, Guyren Howe wrote: >> >>> <http://www.realsoftware.com/feedback/viewreport.php? >>> reportid=gvzcbkhx> >>> >>> Allowing a function to return multiple values: >>> >>> Dim WordCounts(s As String) As Words() As String, Counts() As >>> Integer >>> >>> would be immensely useful and more beginner-friendly. >> >> Also worth mentioning that all of the recently-popular "new" >> languages (PHP, Python, Perl, Ruby) support multiple returns from a >> function. It's really not that scary. > > As well as classic languages such as C and Pascal. > > And all API's from various operating systems. For example, many Apple > Functions return data "by reference" and an error or status code for > the value of the function, where, for example, status of NoError > means the data is valid. Consider, from Apple's Carbon Library, the > pascal call: > > FUNCTION FSRead(refNum: INTEGER; VAR count: LONGINT; buffPtr: UNIV > Ptr): OSErr;
This sort of thing is idiomatic to C, Pascal, etc. In a modern language, the better approach would be to raise an exception. Charles Yeomans _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
