How About Agregate Formation and Return?
Jerry Leichter
leichter at yale-com.UUCP
Sat Nov 5 01:41:30 AEST 1983
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 at yale
More information about the Comp.lang.c
mailing list