Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!yale-com!leichter From: leichter@yale-com.UUCP (Jerry Leichter) Newsgroups: net.lang.c Subject: Re: How About Agregate Formation and Return? Message-ID: <2329@yale-com.UUCP> Date: Fri, 4-Nov-83 10:41:30 EST Article-I.D.: yale-com.2329 Posted: Fri Nov 4 10:41:30 1983 Date-Received: Sun, 6-Nov-83 23:00:26 EST References: hou5d.731 Lines: 14 The biggest use of this kind of aggregate synthesis/analysis is in Mesa. in fact, in Mesa, if f is declared to take an integer argument followed by a real, the semantic effect is really to say that it takes an (unnamed) structure of two fields, the first integer, the second real, as an argument. Because of the way defaults and conversions work, f(1,2.0) works as you expect, but you can also (sometimes? - I don't remember the details) do f(x) where x is a variable whose type is a structure of two fields, etc. The "return" case is completely symmetrical. What makes this all work is that you can build structures on the fly: [1,2.0] is a structure of the appropriate type, as is [i,y] where i and y are integer and real; [i,y] = f(...) is how you would write an assignment when f returns [1,2.0]. -- Jerry decvax!yale-comix!leichter leichter@yale