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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,772ae8afc5db35f2 X-Google-Attributes: gid103376,public From: fraser@synopsys.throw.this.bit.away.com Subject: Re: Can't export object of private type Date: 1999/02/26 Message-ID: <7b6nqe$75m$1@remarQ.com>#1/1 X-Deja-AN: 448796755 References: <7b47m3$l2l$1@remarQ.com> X-Complaints-To: newsabuse@remarQ.com X-Trace: 920052366 KZBGBQC4S164892E1C usenet58.supernews.com Organization: Vegetarian Ada Programmers Newsgroups: comp.lang.ada Originator: fraser@titanic Date: 1999-02-26T00:00:00+00:00 List-Id: I nearly cried when nospam@thanks.com.au said: >:I just love the way Ada compilers fill in .all for me. >Can you give an example? Sure. This is an idiom I use all the time (well, until I wrote a generic dynamic array package, but that's another story): type Array_Type is array (Positive range <>) of Integer; type Array_Access is access Array_Type; X : Array_Access; Y : Integer; Z : Array_Type (1 .. Size); begin X := new Array_Type'(1 .. Size); Y := X (3); -- same as X.all (3) Z := X.all; -- .all required here end; Subprogram access types are similar. Bertrand Meyer goes into this sort of thing in his Eiffel book, but I can't remember the term he used. You know, the bit about everything being accessed the same way, regardless of the underlying type. I think Eiffel (at least in its first incarnation, I haven't checked the language's revision history) goes a little overboard in its race for purity (but that's another article). Not having to worry about whether something's an array or an array access when you index it is a small plus, but it's representative of a wider philosopher. Fraser.