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,c3a7c1845ec5caf9 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Equality operator overloading in ADA 83 Date: 1997/05/05 Message-ID: #1/1 X-Deja-AN: 239652317 References: <01bc4e9b$ac0e7fa0$72041dc2@lightning> <335F5971.6375@elca-matrix.ch> <01bc5244$315f1560$28f982c1@xhv46.dial.pipex.com> <01bc54ef$2621d680$LocalHost@xhv46.dial.pipex.com> <336DC615.285E@elca-matrix.ch> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-05-05T00:00:00+00:00 List-Id: Mats says < ... when b => ... end case; you see immediately, without having to read the whole statement, that a decision is being made that depends only on the value of f(g(x)). Moreover, if f(g(x)) is a long expression, you only have to write it once. if ... elsif does not have these two advantages.>> I can perfectly well live with declare fgx : constant integer := f (g (x)); begin if fgx = a then ... elsif fgx = b then ... end if; end; Yup, it's a little bit longer, but it just does not seem worthwhile confusing the case semantics and adding considerable complexity to the language and its description just to save a few tokens in this case. Actually this example is a big bogus, since it is really implying that the only possible values are a or b, so if the above case is what you mean, and if you really mean to cover all cases, then the above code is equivalent to if f(g(x)) = a then ... else -- = b ... end if; which is actually shorter (8 tokens instead of 11) I don't like introducing extra complexity in languages just for the sake of a bit of syntactical sugar ... A similar example arose during the 9X discussions, where raise x when ... was proposed. dp