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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,555956c1cdd22308 X-Google-Attributes: gid103376,public From: tedennison@my-dejanews.com Subject: Re: Help - Constructors - ASAP. Date: 1998/07/30 Message-ID: <6pqdr2$hn2$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 376402121 References: <6p75qi$rcj@news.latnet.lv> <6pi4jq$j73$1@nnrp1.dejanews.com> Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Thu Jul 30 18:25:38 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.0; Windows NT; Gateway2000) Date: 1998-07-30T00:00:00+00:00 List-Id: In article , eachus@spectre.mitre.org (Robert I. Eachus) wrote: > In article <6pi4jq$j73$1@nnrp1.dejanews.com> dennison@telepath.com writes: > > There are two reasons for following the advice. First is that Ada > has a rule that inherited functions with a controlling result are > abstract, so they must be overridden. Yes, there are cases where > constructor functions can be safely inherited from the parent, but > this rule makes you think it through. Second is that when you do want > a constructor which can return any type in the class, the right thing > to do usually is to make it a classwide type. But what happens in the situation where the client (perhaps a different developer) wants to make a child class with fields that *must* be initialized? That seems a quite reasonable thing to do. But now the class-wide "constructor" isn't valid anymore. It can still be called for this new child object, but will return a garbage value. The only way I can see around this problem is to *also* declare a primitive constructor, and have the body of the class-wide consructor redispatch to that. T.E.D. -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum