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,8e64f4db20d57eb5 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Call by reference vs. call by value Date: 1996/07/22 Message-ID: #1/1 X-Deja-AN: 170539113 references: <31F10E50.726@egr.uri.edu> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-07-22T00:00:00+00:00 List-Id: In article , Robert Dewar wrote: >If you want to think more about this issue, worry about packed arrays >too. Requiring call by reference would mean that ALL packed arrays have >to be passed using general bit pointers, which would be unacceptably >inefficient in the normal case where slices are not passed. Same >thing for records, all records would have to be passed by bit address, >just in case the record you are passing is a field in a rcord with a >record rep clause. Pascal solved this problem in a simple (but rather ugly) way: It's illegal to pass a component of a packed array or record as a parameter. The *programmer* must declare a temp variable, and make a copy. And Pascal doesn't have slices. I suspect part of the reason for Ada's rules (which of course predate the DS annex by a decade) is to avoid the ugliness of the Pascal rule. Unfortunately, the Ada rule introduces an implementation dependence that I find uncomfortable. - Bob