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,65cf1c5c90ed694 X-Google-Attributes: gid103376,public From: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) Subject: Re: Ada vs. C++ (Readability) Date: 1997/09/15 Message-ID: <5vij6m$dvj$1@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 272559928 References: <341566c7.0@news.uni-ulm.de> <5v4kie$jp1@panix.com> <5v9nrm$8lp@panix.com> Organization: Comp Sci, RMIT University, Melbourne, Australia. NNTP-Posting-User: ok Newsgroups: comp.lang.ada Date: 1997-09-15T00:00:00+00:00 List-Id: hymie@panix.com (Hyman Rosen) writes: >What exactly is it about 'ray x = 1, 2, 3;' that you find unreadable? The fact that the comma operator has a standard reading which is completely at variance with this one. Overloading one sequencing operator (comma) makes precisely as much sense as overloading the other sequencing symbol (semicolon). Especially in a declaration, I invite you to consider int y; ray x = 1, 2, y = 3, 4; Is this a _legal_ declaration for a ray x where one component is the value of the assignment y = 3, or is it an _illegal_ attempt to declare two rays, one of the called x and initialised to 1, 2 and the other called y and initialised to 3, 4. Does the answer change if the first declaration of y is deleted? I note that the C9X standard introduces in-line aggregates, so that e.g. ray x(3, (int[]){0, 1, 2}); would be possible. The sooner C++ gets this, the better. >The overloading lets you write vector and matrix initializations in a >completely transparent fashion. It is not _completely_ transparent, because these comma operations can occur in syntactic contexts where the _other_ readings of comma are available, as shown above. >In any case, this is part of the interface of a library for high-speed >computation, and is described clearly in that library's documentation >and examples. I would expect that someone maintaining this code would >first acquaint themselves with this, if they are to have any chance of >success at all. That's not the problem. The problem is that _even when you know what it means_, it still appears ambiguous. -- Unsolicited commercial E-mail to this account is prohibited; see section 76E of the Commonwealth Crimes Act 1914 as amended by the Crimes Legislation Amendment Act No 108 of 1989. Maximum penalty: 10 years in gaol. Richard A. O'Keefe; http://www.cs.rmit.edu.au/%7Eok; RMIT Comp.Sci.