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=0.6 required=5.0 tests=BAYES_05,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!mcvax!jankok From: jankok@cwi.nl (Jan Kok) Newsgroups: comp.lang.ada Subject: Re: Strange syntax Message-ID: <362@zuring.cwi.nl> Date: Thu, 24-Sep-87 05:12:15 EDT Article-I.D.: zuring.362 Posted: Thu Sep 24 05:12:15 1987 Date-Received: Sat, 26-Sep-87 10:26:46 EDT References: <8709231753.AA26614@q.sei.cmu.edu> Organization: CWI, Amsterdam List-Id: In article <8709231753.AA26614@q.sei.cmu.edu> Kenneth.Lee@SEI.CMU.EDU writes: > >The Rational R1000 compiles the code because the first step when a source >unit is promoted to an installed unit is to format the code. The >reformatted code for the line in question is: > Foo : Integer range 1 .. Max_Val + 1 := 15; > > ... Well, this is not an explanation of course. It only says that there is a reformatter that solves correctly the ambiguity with the ':'. I wish to contribute to the discussion (the example is correct Ada) that the colon is not the only ambiguous character where the difficulties have been overlooked by some of the compiler writers. And apparently also by the composers of the ACV suite, since we are talking avout validated compilers. Period, prime, quotation mark and minus may be used to construct other teasers. A try: PUT(A.all'FIRST); PUT(B.all(1)'LAST); C := B--- comment - D; -- or C := B--- comment D; procedure TT is function "*"(A, B:INTEGER) return INTEGER is subtype INT is INTEGER; C :"*".INT:=3; D :TT."*".INT:=4; E:SYSTEM.ADDRESS:= TT."*"'ADDRESS; -- with these declarations, the following example has been on the -- net recently: procedure WRITE ( X:"*".INT) is begin null; -- or something end; begin C:="*".INT'LAST; return (A*"*".INT'(B)); end"*"; begin null; end TT; But who should write real life code like this? :-) Jan Kok. -- Mail: Jan Kok, CWI (afd. NW), Postbus 4079, NL-1009 AB Amsterdam, Nederland Net : jankok@cwi.nl It was twenty years ago today, Sgt. Pepper taught the band to play,