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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6aa1ec264ce25142 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.180.24.202 with SMTP id w10mr3129323wif.0.1346237241040; Wed, 29 Aug 2012 03:47:21 -0700 (PDT) Path: q11ni373543942wiw.1!nntp.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!.POSTED!not-for-mail From: "Vasiliy Molostov" Newsgroups: comp.lang.ada Subject: Re: Real syntax problems in Ada Date: Wed, 29 Aug 2012 14:47:19 +0400 Organization: None Message-ID: References: <1p5r39cusgc1n$.18nj9sytckk6$.dlg@40tude.net> <1xfc5a70g33xq.6o52bn9evjls$.dlg@40tude.net> NNTP-Posting-Host: Xw13RWgh8yxgPSv0x3+H9w.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.01 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2012-08-29T14:47:19+04:00 List-Id: Dmitry A. Kazakov =D0=BF=D0=B8=D1=81=D0=B0=D0= =BB(=D0=B0) =D0=B2 =D1=81=D0=B2=D0=BE=D1=91=D0=BC =D0=BF=D0=B8=D1=81=D1=8C= =D0=BC=D0=B5 Wed, = 29 Aug 2012 11:25:00 +0400: > There is an important operation on bodies: composition: > > type Float_Valued is function (X : Float) return Float; > X : Float_Valued :=3D begin ... end; > Y : Float_Valued :=3D begin ... end; > Z : Float_Valued :=3D Y * X; > > Another operation is inheritance. That is when one body operates T = > another > S and S <: T, inheritance is the body of T composed with type conversi= on = > S > to T. Intriguing. Perhaps this can be distributed on other things, where subprogram can be simply implemented by X * Y. > And of course, parametrization, AKA instantiation of a generic body. = > Simple > non-generic form could deploy discriminants. That would give > specialization: > > type Integrator (Method : ...) is > function (X : Float; ...) return Float; > matching parameters by position only is awkward, perhaps. What about type Integrator (Method : ...) is function (X : Float :=3D Method; ...) return Float; or type Integrator (Method : ...) is function (Method : Float; ...) return Float; (I dont know what type the Method you mean, but assumed it is a float ty= pe) But this arises a question about X * Y where both are types indeed, and = = can have discriminants. I can not imagine this. -- = =D0=9D=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE =D0=B2 =D0=BF=D0=BE=D1=87= =D1=82=D0=BE=D0=B2=D0=BE=D0=BC =D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=B5= =D0=B1=D1=80=D0=B0=D1=83=D0=B7=D0=B5=D1=80=D0=B0 Opera: http://www.oper= a.com/mail/