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=2.2 required=5.0 tests=BAYES_00,INVALID_MSGID, PDS_OTHER_BAD_TLD,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,900edaa189af2033 X-Google-Attributes: gid103376,public From: Thomas.Kendelbacher@erno.de (Thomas Kendelbacher) Subject: Re: Ada95 OOP Questions Date: 1996/08/05 Message-ID: <4u4ln3$fur@mailsrv2.erno.de>#1/1 X-Deja-AN: 172255053 references: organization: Daimler-Benz Aerospace, Space Infrastructure reply-to: Thomas.Kendelbacher@erno.de newsgroups: comp.lang.ada Date: 1996-08-05T00:00:00+00:00 List-Id: In article , dewar@cs.nyu.edu (Robert Dewar) writes: >Generally in Ada 83, people like to avoid use so that when they see >Pkg.xyz they know that they can find the routine that will be called >in Pkg (the spec in the spec of Pkg and the code in the body). > >The trouble is that with a dispatching call, you write Pkg.xyz and it >does NOT mean that the code is in Pkg -- as Laurent noted, it does >mean the relevant spec is in the spec of Pkg, but the whole point of >dispatching is to make sure that at compile time you have no idea >where the code that will actually be called resides, indeed the code >may be in a unit that has not been written yet. > >A number of people find that confusing, and so are willing to onsider >using "use" for the dispatching case. > >You may or may not agree, but it is certain that your previous Ada 83 >experience is not a useful guide here. No, I don't agree at all. Sorry if there has been a thread on this before, I have missed it, but I don't want to restart it either. Just one sentence (or two :-): When grep is your only tool to find out where a procedure FOO_BAR is defined, then this IS a maintenance nightmare, especially for anyone who is not the original author. You're right, my experience which leads me to avoid using use comes from Ada 83, of course (how many large-scale Ada 95 systems are there?), but the argument is still valid! If the introduction of dispatching calls leads people to produce less maintainable code, then this is a *bad* *thing*. (By the way, I don't think it's confusing that the qualifier is the spec where the type is defined; rather, it's a good starting point to narrow down the search for the real code. Using use here leaves you with no clue at all! And this "confusing" point is not peculiar to dispatching calls: it occurs with Ada 83 derived types as well. Not new, although the "search direction" is reversed in that case.) Just my 2p. -- Thomas Kendelbacher | email : Thomas.Kendelbacher@erno.de DASA RI / Abt. RIT14 | voice : +49 421 539 5492 (working hours) Postfach 28 61 56 | or : +49 421 57 04 37 (any other time) D-28361 Bremen | fax : +49 421 539 4529 (any time) Germany