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.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a1beac047b98caeb X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-12 11:21:36 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: ANH_VO@udlp.com Newsgroups: comp.lang.ada Subject: Re:Why default values not taken? Date: Tue, 12 Jun 2001 11:13:00 -0500 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 992370023 62624 137.194.161.2 (12 Jun 2001 18:20:23 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Tue, 12 Jun 2001 18:20:23 +0000 (UTC) To: comp.lang.ada@ada.eu.org Return-Path: Content-Description: cc:Mail note part Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.4 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:8619 Date: 2001-06-12T11:13:00-05:00 Do not use aggregate since completion is required. The simplest way is to use dot notation. declare Contact_Person := new Text_Item; begin Contact_Persion.Remark := US("name and email"); end Anh Vo ____________________Reply Separator____________________ Subject: Why default values not taken? Author: "M. A. Alves" Date: 6/12/01 3:53 PM I want to create an object with only some components different from their default values e.g. Contact_Person := new Text_Item'(Remark => US("name and email")); where Text_Item inherits Remark from Input_Item and adds Text, both defaulting to Null_Unbounded_String: type Input_Item is tagged record Remark: Unbounded_String; end record; type Text_Item is new Input_Item with record Text: Unbounded_String; end record; Of course I get the compile error "no value supplied for component Text". But do I really have to supply values for all components? What is the best idiom here? Thanks, -- , M A R I O data miner, LIACC, room 221 tel 351+226078830, ext 121 A M A D O Rua Campo Alegre, 823 fax 351+226003654 A L V E S P-4150 PORTO, Portugal mob 351+939354002