From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=BAYES_20,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1042f393323e22da X-Google-Attributes: gid103376,public From: Alan Brain Subject: Re: Any research putting c above ada? Date: 1997/05/16 Message-ID: <337D3AE4.28F7@dynamite.com.au>#1/1 X-Deja-AN: 241886829 References: <208C9C61CA05C32B.65D82DC950AAA33A.D68E7B27EB42E98A@library-proxy.airnews.net> <3372D44E.5F44@sprintmail.com> <337813DF.598C@dynamite.com.au> Organization: @Home Reply-To: aebrain@dynamite.com.au Newsgroups: comp.lang.ada Date: 1997-05-16T00:00:00+00:00 List-Id: Kevin Cline wrote: > This is useless when the size of the array required is computed inside the > function. Some kind of dynamic data structure is required to write this code > with reasonable efficiency. Why so? Consider a variant record, ie a primitively polymorphic one such as: Type fooRecord (KindOfFoo : FooType := GreenFoo) is record case KindOfFoo is when GreenFoo => -- blah blah blah when BlueFoo => -- rhubarb rhubarb when other => null; end case; end record; A variable of type fooRecord could be passed (via an in out) into a procedure as a BlueFoo, and come out as a GreenFoo. This can be quite astoundingly complex if, say, BlueFoo is a record of DEMONgrams (each of which is an array of arrays whose size is variable), GreenFoo an array of records containing arrays of records containing arrays of arrays whose size is fixed (as in a FRAZ spectrum analysis). Simple really, and a real example. Nary a pointer or access type anywhere. -- aebrain@dynamite.com.au <> <> How doth the little Crocodile | Alan & Carmel Brain| xxxxx Improve his shining tail? | Canberra Australia | xxxxxHxHxxxxxx _MMMMMMMMM_MMMMMMMMM 100026.2014 compuserve o OO*O^^^^O*OO o oo oo oo oo By pulling MAERKLIN Wagons, in 1/220 Scale See http://www.z-world.com/graphics/z/master/8856.gif for picture