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,7402728c011ea87a X-Google-Attributes: gid103376,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Re: Efficient io of arbitrary binary data. Date: 1996/09/14 Message-ID: <1996Sep14.153426.1@eisner>#1/1 X-Deja-AN: 180626549 x-nntp-posting-host: eisner.decus.org references: <3239B3B2.1AE4@cray.com> x-nntp-posting-user: KILGALLEN x-trace: 842729674/8877 organization: LJK Software newsgroups: comp.lang.ada Date: 1996-09-14T00:00:00+00:00 List-Id: In article <3239B3B2.1AE4@cray.com>, "Brian R. Hanson" writes: > I a puzzled. The approaches which Ada seems to allow all require > much more copying of data as I am not allowed to return a reference > to a slice of an array I can only return the slice itself. Presuming the concern is runtime efficiency rather than code inspection efficiency :-), whether you return a slice or a reference to a slice may be immaterial. A compiler with aggressive optimization may generate inline code for your whole "read" function, making the object code for the two methods equivalent. When programming in Ada you have given the compiler more information than programming in C, so it has more opportunity to optimize. Based on your return address, I would presume folks in your shop are big on optimizing compilers. Larry Kilgallen