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.9 required=5.0 tests=BAYES_00,WEIRD_QUOTING,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,90514f9a192a4997,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-05 06:35:48 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!82-43-33-75.cable.ubr01.croy.blueyonder.co.UK!not-for-mail From: "Nick Roberts" Newsgroups: comp.lang.ada Subject: Expectation of Access Value Equality Date: Fri, 5 Sep 2003 14:35:40 +0100 Message-ID: NNTP-Posting-Host: 82-43-33-75.cable.ubr01.croy.blueyonder.co.uk (82.43.33.75) X-Trace: news.uni-berlin.de 1062768946 17486449 82.43.33.75 (16 [25716]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Xref: archiver1.google.com comp.lang.ada:42174 Date: 2003-09-05T14:35:40+01:00 List-Id: I'm asking for the help of Ada programmers of all levels of experience. Given the following declarations: type A_String is access constant String; function "+" (S: String) return A_String is begin return new String'(S); end; type A_String_Array is array (Positive range <>) of String; procedure Print (A: in A_String_Array) is Sentinel: constant A_String := A(A'Last); Current: Positive := A'First; begin loop Put_Line( A(Current).all ); exit when A(Current) = Sentinel; Current := Current + 1; end loop; end; (a) Would you be surprised by: Print( (+"foo",+"bar",+"",+"") ); printing three lines? (b) Would you be surprised by: Print( (+"foo",+"bar",+"hum",+"foo") ); printing one line? (c) What would you think of an implementation that caused this behaviour? (What would you think of an implementation that printed four lines in both cases?) (d) I'd be grateful for a very brief indication of your level and broad area(s) of programming experience, in Ada and other languages. I would be very grateful for as many people replying as possible, preferably in this news group, but privately if you prefer. Thanks. -- Nick Roberts E-mail: nickroberts@blueyonder.co.uk Jabber: debater@charente.de [ICQ: 159718630]