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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,24d7acf9b853aac8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Natasha Kerensikova Newsgroups: comp.lang.ada Subject: Re: S-expression I/O in Ada Date: Sun, 22 Aug 2010 10:21:08 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <547afa6b-731e-475f-a7f2-eaefefb25861@k8g2000prh.googlegroups.com> <4c6bc259$0$6887$9b4e6d93@newsspool2.arcor-online.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 22 Aug 2010 10:21:08 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="Mda950WjNwNLAFOE7yJXQw"; logging-data="9910"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19iEFQ0hVP3+GZz0ABgptXV" User-Agent: slrn/0.9.9p1 (FreeBSD) Cancel-Lock: sha1:WVUymbODC6jYTHjIFFImqWabGuE= Xref: g2news1.google.com comp.lang.ada:13597 Date: 2010-08-22T10:21:08+00:00 List-Id: On 2010-08-20, Yannick DuchĂȘne wrote: > Depends if it has a default discriminant or not. If it has, and you > declare an object of such a discriminated type somewhere, without > initialization, you will got nearly the same, except that in Ada you will > not be allowed to change arbitrary members without regards to the actual > discriminant. If you want to change it, you will have to assign the object > as a whole, to give both the new discriminant and the value of the members > which will comes into live with it. This is very interesting, it will help when I write the parser (with per-state context information). But then it means the following type allow some sort of dynamic array? type Dynamic_Whatever_Array (Size : Natural := 0) is array (1 .. Size) of Whatever; Then is there a simpler way to replace the object than : procedure Foo is object : Dynamic_Whatever_Array; Computed_Size : Natural; begin ... Computed_Size := ...; ... declare new_object : Dynamic_Whatever_Array(Computed_Size); begin -- initialize new_object contents object := new_object; end; ... end Foo; Or is it complete nonsense? Thanks for your help, Natacha