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,f6c4733a3385e3f8 X-Google-Attributes: gid103376,public From: mfeldman@seas.gwu.edu (Michael Feldman) Subject: Re: I just found that funny... Date: 1996/04/06 Message-ID: <4k6lgc$288@felix.seas.gwu.edu>#1/1 X-Deja-AN: 146137244 references: <199604051600.SAA07609@email.enst.fr> organization: George Washington University newsgroups: comp.lang.ada Date: 1996-04-06T00:00:00+00:00 List-Id: In article , Robert Dewar wrote: >Incidentally, this is a nice example on which to demontstrate an interesting >little bit of error handling stuff in GNAT: [snip] >Note that GNAT guesses by your casing whether you intended to write >an identifier or keyword. Of course it only pays attention to case *if* >Just in case you are Mike Feldman (:-) or someone else who likes to use >some different casing convention: > > 2. FUNCTION Last_Day (Of : Months) RETURN Date; > | > >>> reserved word "OF" cannot be used as identifier > > 2. FUNCTION Last_Day (OF : Months) RETURN Date; > | > >>> identifier expected Now, now, Robert. Careful readers of the notorious programs you referred to, with their upper-cased RESERVED WORDS, would know that the FUNCTION would also be named LastDay :-) On a more serious note, GNAT's "learning" the lexical style of the programmer, and using it to make better guesses at errors, is extremely clever. Mike Feldman