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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c0d4e990924eb044 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.posted.plusnet!news.posted.plusnet.POSTED!not-for-mail NNTP-Posting-Date: Fri, 13 Mar 2009 11:31:23 -0500 Message-ID: <49BA8A57.7090200@tgrowe.plus.net> Date: Fri, 13 Mar 2009 16:31:19 +0000 From: Tim Rowe User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 Newsgroups: comp.lang.ada To: "Alex R. Mosteo" Subject: Re: Newbie question -- dereferencing access References: <72516b38-1711-4588-b53b-7b42773f70c2@w34g2000yqm.googlegroups.com> <1IednThMP8E8sCfUnZ2dnUVZ8suWnZ2d@posted.plusnet> <71ut2oFn4m2pU1@mid.individual.net> In-Reply-To: <71ut2oFn4m2pU1@mid.individual.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-Z7ZMYVyErlLk5ejZ/38pF4JYY/m4qZBiduKx6o2mifGkg6plUru93oJVCPBv0P1AwhaWNzHMkD+b7JX!sKif5+TbVeFZm2nrrSm+GCZZumb4/wg7zNtQ/X2HQ6iqyAkHEUAxBAEHu8ufDH9IERh9 X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 Xref: g2news1.google.com comp.lang.ada:4108 Date: 2009-03-13T16:31:19+00:00 List-Id: Alex R. Mosteo wrote: > While these are certainly important skills, one thing you should notice when > transitioning to Ada is a decreased need for access types thanks to > unconstrained/indefinite types. I'd think that would mean that you're in the > right track. But I can't put an unconstrained type into a record. I realise that I can make the record discriminated and constrain the type on the discriminant, trying to write a class that gives strtok-like functionality -- the excercise I have set myself at the moment -- means that I discover the sizes of relevant strings rather late in the game. > Anyway, if you have a sound knowledge of memory management in C/C++, it's > pretty much the same. Don't forget to deallocate, wrap it all in a > controlled type. What I'm feeling the lack of is destructors for classes (sorry, for tagged records). I suspect I'll find what I need when I learn about finalizers, but whereas in C++ I learned about delete at the same time as I learned about new, and I learned about destructors at the same time as I learned about constructors, it seems strange in Ada to find access allocation addressed in the mainstream and access deallocation relegated to an advanced topic (and destructors nowhere in my sight). And yet it's C/C++ that has the reputation for memory leaks!