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: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Subscript brackets Date: 1996/05/01 Message-ID: #1/1 X-Deja-AN: 152461723 references: <4m515d$pok@calypso.bns.com.au> organization: The Mitre Corp., Bedford, MA. newsgroups: comp.lang.ada Date: 1996-05-01T00:00:00+00:00 List-Id: In article <4m515d$pok@calypso.bns.com.au> mike@calypso.bns.com.au (Michael Talbot-Wilson) writes: > Are there any plans to convert from parentheses to square brackets > for array subscripts in Ada? Not in this millenium.... > Maybe this is a minor point, and I guess BASIC, PL/I and FORTRAN > programmers think it's better as it is. (And I guess the use of > parentheses reflects that Ada's heritage is in those languages.) No, it reflects a unification between tabular data and functions which is totally intentional. I often prototype with many complex options being tables in the prototype, and functions in the final product: type Message_Length is array (Message_Type) of Integer; ... function Message_Length(M: in Message_Type) return Integer; This allows the message lengths to be changed in a table without recompiling things. > But C, Pascal, Modula-2 and (if there are any left alive) ALGOL > programmers feel the reverse. Minor or not, it is a big psycho- > logical hurdle to adjust to something inferior (and even the FAQ > concedes that this is a broken feature) in the name of doing > things better. > 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 have a better idea...write a preprocessor to replace square brackets with angle brackets, and you will have no problem using existing Ada compilers. I could probably write a very good preprocessor of this form in a couple hours. However, if you decide to do realistic error checking, you have a lot of decisions to make. Do all attributes use parentheses, or just those which are functions? If A'First[1] requires brackets, what about A'Range(1)? You get the picutre. > 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 it. It could be done, but it would be a rough haul for very little gain. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...