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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,953e1a6689d791f6 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,953e1a6689d791f6 X-Google-Attributes: gid103376,public From: donh@syd.csa.com.au (Don Harrison) Subject: Re: Eiffel and Java + Ada dispatching Date: 1996/11/22 Message-ID: #1/1 X-Deja-AN: 197990704 sender: news@syd.csa.com.au x-nntp-posting-host: dev50 references: <32913613.341C@direct.ca> organization: CSC Australia, Sydney reply-to: donh@syd.csa.com.au newsgroups: comp.lang.eiffel,comp.lang.ada Date: 1996-11-22T00:00:00+00:00 List-Id: Vincent Celier writes: :Don Harrison wrote: : :> I'd have to say that I never instantiate anything in Ada without explicitly :> providing actual parameters. I think it makes it easier to see what's going :> on at the instantiation site without having to check the generic declaration :> to see that a default isn't unwittingly being used. So, rather than being :> disappointed that Eiffel doesn't have default actual parameters, I'm glad :> that it doesn't. :Default parameters are very useful when low-level interfaces need to :migrate. : :To remove a generic formal: : 1- Add a default: upwardly change, no client code should be : affected, : 2- Ask all client to remove the obsolete parameter in their :instantiations : 3- When all clients have done 2, remove the generic formal. : :To add a new generic formal: : 1- Add the new generic formal, with a default, : 2- Ask all clients to add an actual parameter in all instantiatrions, : 3- Remove the default. Yes, this technique works. We've used it here occasionally with Ada-83 and I agree it's appropriate in that context. However, in an OO context, I would do it differently: 1) Define a new generic class inheriting the stuff it needs (from the original or an ancestor thereof) and adding whatever new stuff it requires. 2) Convert clients when convenient to use the new generic. This way, you retain the benefit of being able to see the parameters at the site of instantiation and avoid the transitional state of obsolesence. :-- Always looking for experienced Ada developpers willing to live in :BBC, :-- (Beautiful British Columbia). You mean they need to be persuaded? :) Some people don't know what's good for them. Don. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Don Harrison donh@syd.csa.com.au