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 X-Google-Thread: 103376,7f4d16c4ee371eb5 X-Google-Attributes: gid103376,public From: "Samuel T. Harris" Subject: Re: Why is it Called a Package? Date: 2000/04/07 Message-ID: <38EE19E0.F0232DB0@Raytheon.com>#1/1 X-Deja-AN: 608067898 Content-Transfer-Encoding: quoted-printable References: <38DF7F38.8D656ABD@lmtas.lmco.com> <38DFB0BC.9FF72EFC@callnetuk.com> <87u2hq857e.fsf@deneb.cygnus.argh.org> <38E2A4A4.E59E997C@research.canon.com.au> <8ck2mt$jrn$1@clnews.edf.fr> X-Accept-Language: en Content-Type: text/plain; charset=iso-8859-1 Organization: Raytheon Aerospace Engineering Services Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-04-07T00:00:00+00:00 List-Id: Pascal Obry wrote: > = > Brian Rogoff a =E9crit dans le message : > Pine.BSF.4.21.0004061305320.6588-100000@shell5.ba.best.com... > > I think if the syntax were to be redone I'd like the issue of "()" ve= rsus > > "[]" for array indexing to be reexamined. Then we could also think ab= out > > some syntactic sugar for overloading "[]" as in C++. The restrictions= on > > the character set that were part of the original Ada requirements don= 't > > make a lot of sense to me now, though the restriction to ASCII is OK.= > = > I don't think we want that. A very nice consequence here is that you ca= n > easily change an abstraction from: > = > package P is > Some_Value : array (1 .. 10) of Integer; > -- first quick implementation using basic array > end P; > = > to > = > package P is > function Some_Value (N : in Positive) return Integer; > -- real implementation using a complex structure > end P; > = > (or the other way around) without modifying all client code. > = > I really don't see what would be gained by using "[]"... a more > C/C++ syntax :) I'd rather see [] and {} be allowed as substitutions for () in a similar way that ! of allowed for |, % is allowed for ", and : is allowed for #. Of course, just as %'s substituded for " have to be paired, so would {} and [] substitutions. I see no compelling reason why array indexing must be syntactically different from function calls. I do see that some Ada code, especially when building complex aggregates, starts to look like LISP (Lots of Insane Silly Parentheses). I'd like to be able to use {} and [] for different levels of (). If one then wants to make a style guide issue out of using [] for indexing and {} to bracket all aggregates, then fine. This is a very easy and backward compatible change to the language definition. I suppose Apex would have a problem since it uses [] for statement prompts. OTOH there are still many more characters it can use for statement prompt delimiters. -- = Samuel T. Harris, Principal Engineer Raytheon, Aerospace Engineering Services "If you can make it, We can fake it!"