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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,57f8540942f8e060 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Initialization and Finalization of limited object "returned" by a function Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <41b794ec-26b0-485e-a959-580a5b877a3b@f15g2000yqe.googlegroups.com> <8e09c20d-172e-42a2-b2ff-994863893523@h12g2000yql.googlegroups.com> Date: Sun, 14 Feb 2010 11:59:44 +0100 Message-ID: <1js6r6txuzjqz$.uah5yuqtg8md$.dlg@40tude.net> NNTP-Posting-Date: 14 Feb 2010 11:59:35 CET NNTP-Posting-Host: 22ba3cce.newsspool3.arcor-online.net X-Trace: DXC=VcE^^:cPK>oJ00P1S40fZgMcF=Q^Z^V3h4Fo<]lROoRa8kFlUnLDPb X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:9212 Date: 2010-02-14T11:59:35+01:00 List-Id: On Sat, 13 Feb 2010 10:53:06 -0500, Robert A Duff wrote: > "Dmitry A. Kazakov" writes: > >> Nope, the mathematical notation for a tuple is as in Ada (a,b,c,...), so >> should it be. > > Well, none of the following Ada operators use the standard maths > notation: > > - * / ** <= >= /= and or not Hey, somebody pushed for Unicode in Ada2005. Isn't it time now to fix that? (:-)) http://en.wikipedia.org/wiki/Unicode_mathematical_operators > And named notation: > > Date'(Year => 2010, Month => February, Day => 1) > > is not standard maths notation -- it's superior to maths > notation. I don't know if there is a math notation for date. But Date' prefix is obviously offending. BTW, ISO date notation is 2010-02-01. Here we go: type Month_Date is record Year : Year_Number; Month : Month_Number; end record; function "-" (Year : Year_Number; Month : Month_Number) return Month_Date is begin return (Year, Month); end "-"; function "-" (Left : Month_Date; Right : Day_Number) return Time is begin return Time_Of (Left.Year, Left.Month, Right); end "-"; T : Time := 2010-02-01; Isn't Ada great? > In general, I find Ada programs much easier > to read that math textbooks, so I'm reluctant to borrow > too much from maths. Agreed. But that depends on who writes the text/program. Mathematicians are famous for being worst programmers ever. So I am not surprised that their books are as unreadable as their programs. But it is the notation, which allows to decipher at least something from that mess. It is 1000 years of natural selection that brought this notation up. I remember reading some ancient books on analysis and linear algebra when I was a student. They were absolutely incomprehensive. They consistently avoided use of O() and o(), wrote all limits in expanded, they do also all matrices (a11, a12, ... a1N, a21, a22, ... ...) instead of just A etc. (:-)) >>... I see no problem in having it ambiguous (overloaded). > > That's too much overloading, for my taste. But keyed notation for a singleton is not only boring. It is counterintuitive. There *nothing* to reorder there. It is just one element. What does the index here? (Of course, we consider only the case where the aggregate's length is known) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de