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,131f06967722ab4b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!transit.nntp.hccnet.nl!transit1.nntp.hccnet.nl!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!news-peer0-test!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: Martin Dowie Newsgroups: comp.lang.ada Subject: Re: Ada 2005? Date: Tue, 21 Dec 2004 06:51:22 +0000 (UTC) Organization: BT Openworld Message-ID: References: <1103344064.372396.51420@c13g2000cwb.googlegroups.com> <1103570622.576598.204440@f14g2000cwb.googlegroups.com> NNTP-Posting-Host: host81-152-56-142.range81-152.btcentralplus.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: hercules.btinternet.com 1103611882 28383 81.152.56.142 (21 Dec 2004 06:51:22 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Tue, 21 Dec 2004 06:51:22 +0000 (UTC) In-Reply-To: <1103570622.576598.204440@f14g2000cwb.googlegroups.com> X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0RC1 (Windows/20041201) Xref: g2news1.google.com comp.lang.ada:7117 Date: 2004-12-21T06:51:22+00:00 List-Id: conradwt@runbox.com wrote: > Hi Martin, I'm not hung up on a 'class' keyword but this would make it > clear as to what one is trying to do in the converting steps from C++ > to Ada. I think there was plenty of debate about creating a new reserved word 'class' in the Ada9X development but 'tagged' won. I'm sure the rationale is probably still kicking around on the net somewhere... > Also, this was an example from one of the Ada resources and > you'll find it at the following address: > > http://www.adahome.com/Ammo/Cplpl2Ada.html > Thus, you're saying that I could have declared the functions as > followed: > > function Name return String; > function Major return Integer; > function Minor return Integer; Nearly but there is no implicit 'this' parameter as there is in C++, so will still need to name it (and its type). > Then, you're saying that I can use it as follows: > > aDevice : Device_Type := Devices.Create( "Test", 1, 1 ); aDevice : Device := ...; > Put_Line( aDevice.Name ); > Put_Line( aDevice.Major ); > Put_Line( aDevice.Minor ); In Ada200Y, yes. Cheers -- Martin