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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b6e97963d32ee242 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-23 08:22:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newshosting.com!news-xfer2.atl.newshosting.com!btnet-peer0!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: john@nospam.demon.co.uk (John McCabe) Newsgroups: comp.lang.ada Subject: Re: The old "Object.Method" syntax debate Date: Fri, 23 May 2003 15:21:29 +0000 (UTC) Organization: BT Openworld Message-ID: <3ece3add.27546339@news.btclick.com> References: <254c16a.0305210726.485125de@posting.google.com> NNTP-Posting-Host: host217-37-177-69.in-addr.btopenworld.com X-Trace: sparta.btinternet.com 1053703289 4213 217.37.177.69 (23 May 2003 15:21:29 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Fri, 23 May 2003 15:21:29 +0000 (UTC) X-Newsreader: Forte Free Agent 1.21/32.243 Xref: archiver1.google.com comp.lang.ada:37698 Date: 2003-05-23T15:21:29+00:00 List-Id: On Fri, 23 May 2003 14:43:49 GMT, "Steve" wrote: >If only we could add an alternate syntax for defining the methods (functions >and procedures) associated with an object, such as: > > type obj is tagged > record > field : Integer; > function Fun1( in; value : in integer ) return Integer; > procedure Proc1( in out; value : in out integer ); > end record; An alternative I though of some time back was to 'enhance' the package construct a 'class package' or perhaps a 'tagged package'. So instead of: package X is type obj is tagged record a : integer; b : float; end record; procedure method (object : in out obj); end X; You could have something like: tagged package X is a : integer; b : float; procedure method; end X; So 'a' and 'b' would be object attributes and 'method' would be an object method. This sort of package would essentially define a single tagged type without all of the record definition and controlling parameters etc. Further you could use: tagged package Y is new X with c : some_enumerated_type; end Y; etc.. Best Regards John McCabe To reply by email replace 'nospam' with 'assen'