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.1 required=5.0 tests=BAYES_00,INVALID_MSGID, TO_NO_BRKTS_PCNT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1bad3dcf22d5a071,start X-Google-Attributes: gid103376,public From: Martin Dowie Subject: Generics and parameter modes Date: 1999/08/16 Message-ID: <37B85F88.C87638C4@dowie-cs.demon.co.uk>#1/1 X-Deja-AN: 513485998 Content-Transfer-Encoding: 7bit X-NNTP-Posting-Host: dowie-cs.demon.co.uk:193.237.34.207 X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@demon.net X-Trace: news.demon.co.uk 934829915 nnrp-12:8865 NO-IDENT dowie-cs.demon.co.uk:193.237.34.207 MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-08-16T00:00:00+00:00 List-Id: i have an instance of a package similar to the generic listed below. when calling the 'size' routine the actual parameter is passed by copy and not by reference as i had expected. this is really annoying as the data object is a few hundred kbytes in size! is there anything in Ada95 that allows/requires this? generic type an_item is private; maximum_number_of_items : positive; package generic_list is subtype a_number_of_items is natural range 0 .. maximum_number_of_items; subtype an_item_index is natural range 1 .. maximum_number_of_items; type a_list is private; -- Lots of other stuff... function size (list : in a_list) return a_number_of_items; private type an_array_of_items is array (an_item_index) of an_item; type a_list is record current_size, current_item : a_number_of_items; items : an_array_of_items; end record; end generic_list; the type used in the declaration is a variant record which it self contains variant fields within a number of the variant branches (approx. 300 bytes storage required). i'm using Rational Apex v3 and have tried a mini version at home (using the above) and ObjectAda seems to pass it by reference (not 100% on this as my Intel assembler knowledge is zilch!).