Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!mit-eddie!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!sci.kun.nl!cs.kun.nl!eerke From: eerke@cs.kun.nl (Eerke Boiten) Newsgroups: comp.theory Subject: Re: Why not multiple out parameters? [again] Message-ID: <2147@wn1.sci.kun.nl> Date: 12 Sep 90 09:10:37 GMT References: <1990Aug28.203643.11214@zaphod.mps.ohio-state.edu> <4019@rex.cs.tulane.edu> <2501@l.cc.purdue.edu> <4060@rex.cs.tulane.edu> <3352@stl.stc.co.uk> <3788@osc.COM> Sender: root@sci.kun.nl Lines: 22 In article <3788@osc.COM> jgk@osc.COM (Joe Keane) writes: >I think returning a record just gets around the issue. We don't use a single >record to pass all the in parameters to a function, so why should we do it for >out parameters? In transformational programming (and, probably, elsewhere) it is often convenient to assume that functions have just one argument (which may be a tuple). So we *do* use a single record to pass all the in parameters sometimes. The problem of using a record for the out parameters is that the function f below is not the identity function: f(x) = 7*a+a where (a,a) = x/7 (assuming x/7 = (x DIV 7, x MOD 7)) but who would disagree to this being a (static) semantic error? Eerke Boiten Department of Informatics (STOP Project), K.U.Nijmegen Toernooiveld, 6525 AD Nijmegen, The Netherlands Tel. +31-80-612236. Email: eerke@cs.kun.nl