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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,bd28f16b863c1f57 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: function "and" Date: Wed, 6 Oct 2004 11:33:55 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de yU+EduacFkDOK7ovJeyreAsAiQzTSuqgDsk7WvLTBukRwcGzk= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:4785 Date: 2004-10-06T11:33:55+02:00 List-Id: On Tue, 5 Oct 2004 20:58:50 +0200, Rick Santa-Cruz wrote: > if I wanna overload the operator "and" then why I have to use quotes? > Are there other cases when I have to use quotes? Everywhere you want to use functional notation instead of operational one. Compare: X, Y : Boolean; ... if X and Y then -- operator 'and' in infix context ... if "and" (X, Y) then -- operator 'and' as a function Both 'and' and '"and"' refer the same thing, but in different contexts. When you declare an operator you the only valid notation is functional, so function "and", function "abs" etc. If 'and' were not a reserved word in Ada, then one could also declare funny: function and (X, Y : Boolean) return Boolean renames "and"; -- Not legal! So that: (X and Y) = "and" (X, Y) = and (X, Y) Nevertheless, "and"() and and() cannot be equalized, because otherwise any unary or binary function declared would automatically become an operator, and so kill the language grammar. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de