Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!iuvax!noose.ecn.purdue.edu!mentor.cc.purdue.edu!l.cc.purdue.edu!cik From: cik@l.cc.purdue.edu (Herman Rubin) Newsgroups: comp.theory Subject: Re: Why not multiple out parameters? [again] Summary: Gross inefficiency is the result Message-ID: <2501@l.cc.purdue.edu> Date: 1 Sep 90 15:22:46 GMT References: <1990Aug28.203643.11214@zaphod.mps.ohio-state.edu> <4019@rex.cs.tulane.edu> Organization: Purdue University Statistics Department Lines: 37 In article <4019@rex.cs.tulane.edu>, fs@rex.cs.tulane.edu (Frank Silbermann) writes: > > In article <11831@ogicse.ogi.edu> > dinucci@ogicse.ogi.edu (David C. DiNucci) writes: | > | > ... at higher "system" levels | > modules are being composed which each do a fair amount of work, | > and thus are likely to return many different kinds of results. | > Plugging these results into a record structure | > just so they can be pulled back apart again is nonproductive. > > When a collection of diverse of values > forms a single conceptual unit, > it should be treated as a unit within the program. > Therefore we define a record-type to represent the concept, > > If a module's different kinds of results > do _not_ form a conceptual unit, > then the design is kludgy and should be redone. > What ever happened to the idea that every module > should perform a single conceptual operation > (i.e. produce a single conceptual result)? Kludgy it is not. For example, a procedure can produce a result and a domain indicator, such as the truth of a condition. Or an integer quotient and a floating remainder can be produced. Or a short integer exponent and a mantissa. Or the decomposition of a word into fields, one being translated into a sign, another into an integer, and the rest into a floating point number. All of these are natural and useful multiple outputs. Putting these into a record to extract later is very definitely non-productive, just as encoding multiplication as repeated addition is non-productive. -- Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907 Phone: (317)494-6054 hrubin@l.cc.purdue.edu (Internet, bitnet) {purdue,pur-ee}!l.cc!cik(UUCP)