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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: I'm facing an issue with: call to abstract procedure must be dispatching Date: Wed, 9 Dec 2015 14:42:24 +0100 Organization: A noiseless patient Spider Message-ID: References: <8bc7fd76-f00a-4eea-9715-470af028fc84@googlegroups.com> <1krm4xun4e4ny.jmh9kvf6s0a9.dlg@40tude.net> <12dc7aea-933d-4271-95bd-10df808917e4@googlegroups.com> <5hfb2q9imjfu.zs3xp9gxw0d3.dlg@40tude.net> <5788b259-8886-4ee2-8c3d-7799abfd840e@googlegroups.com> <14acd8b0-a5e9-40fd-b7cc-d319f914d507@googlegroups.com> <1j28s23yiy4it$.86sbf42gu6wk.dlg@40tude.net> Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 9 Dec 2015 13:39:56 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="b96887e80893c84a90c3007226ca0d1c"; logging-data="2898"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/TI6HHAf3ttvvCpxiARe7tTlr1r4UIkRM=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 In-Reply-To: <1j28s23yiy4it$.86sbf42gu6wk.dlg@40tude.net> Cancel-Lock: sha1:nQaPmT1YY2y1PzUjfsipKHsiM+c= Xref: news.eternal-september.org comp.lang.ada:28736 Date: 2015-12-09T14:42:24+01:00 List-Id: On 09.12.15 13:03, Dmitry A. Kazakov wrote: > You mean procedural types? Not exactly procedural types. I'd like a reflection of a more clear cut distinction between when a(n MI-)type is needed for (M)dispatching versus when the (MI-)type is needed for materializing actual objects. Maybe that simplifies things. Example below. > The bottom line, you can have your lazy blocks only when not reusable and > weakly typed. Put differently, at some point I can use "weakly" typed blocks for getting a job done that warrants just the necessary effort. (Yeah, I guess it's not the dream of an engineer who is looking for some kind of "just technical perfection".) For some perspective, dispatching can look a lot like a specially crafted procedural thing. I think that there are cases related to MD (as in the example of storing from Objects'Class into Databases'Class) when declaring a regular named (MI-)type would be going over the top. procedure Demo is package Root is type T is abstract tagged private; procedure Op (X : in out T; Val : Natural) is abstract; private type T is abstract tagged record Identity : Natural; -- := ...; end record; end Root; package Twigs is type A is new Root.T with record null; end record; overriding procedure Op (X : in out A; Val : Natural); type B is new Root.T with record null; end record; overriding procedure Op (X : in out B; Val : Natural); end Twigs; package body Twigs is separate; package X is procedure D12 (Left : in out Root.T'Class; Right : in out Twigs.B'Class); procedure D22 (Left : in out Twigs.A'Class; Right : in out Twigs.B'Class); end X; package body X is separate; Va : Twigs.A; Vb : Twigs.B; begin -- not Ada do X.D12 with X.D2'Type (Left => V1, Right => Vb); do X.D22 with X.D2'Type (Left => Va, Right => Vb); do X.D22 with X.D2'Type (Left => Va, Right => Va); -- no end Demo; The last lines are not really needed, but they show where there is a type lurking.