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,c1effc80c3046ad X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Subscript brackets Date: 1996/05/02 Message-ID: #1/1 X-Deja-AN: 152615848 references: <4m515d$pok@calypso.bns.com.au> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-05-02T00:00:00+00:00 List-Id: In article <4m515d$pok@calypso.bns.com.au>, Michael Talbot-Wilson wrote: >Are there any plans to convert from parentheses to square brackets >for array subscripts in Ada? No way. I like square brackets for array indexing, too. I understand the uniform-reference argument that Roberts Eachus and Dewar gave, but I don't buy it. The semantics of arrays and functions are different enough, in my opinion, that using the same notation is a confusion, IMHO. And, when combined with the fact that parameterless function calls don't have parens, it adds a big chunk of complexity to Ada compilers, for little benefit. Historically, I believe the uniform-reference argument was *part* of the original reason for not using square brackets. Another part was that the early requirements documents for Ada stated that the character set used had to be restricted, so that it could be used on things like teletype machines. I also think that square brackets, or *some* other notation, should have been used for aggregates. This would solve the problem that you can't write a positional array aggregate with one element, in Ada, because it would be confused with a parenthesized expression. You also can't write a zero-element positional array aggregate, which is another design flaw. >Maybe this is a minor point, ... Yes, it's a minor point, which is why it's not likely to change. >A preprocessor which converted just these parentheses to brackets >and left non-array-subscript parentheses alone would allow >existing source to be compiled. And (I guess) remove the ambiguities >of parsing this feature from the compiler, allowing its cost to >be more clearly seen. I'm not sure what you mean, here. The preprocessor reads standard Ada, and outputs square brackets instead? Such a preprocessor needs to do overload resolution, which makes it approximately as complex as the front end of an Ada compiler. Seems like a lot of trouble for a "minor point". >It there any intention of doing this? Is there any suggested date >when it might happen? I think some people who would like to convert >to or start working in Ada would like a date to aim at, supposing it >is ever going to happen. I doubt if a lot of people who would like to use Ada are holding off because of this minor syntactic point. - Bob