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,b5ab7c96b188b59e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-17 13:15:50 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: The "()" operator revisited. Date: 17 Jan 2004 16:15:49 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <820a00puecpmodp3vg43gpd7063rr5lj8q@4ax.com> NNTP-Posting-Host: pip1-5.std.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1074374150 7019 192.74.137.185 (17 Jan 2004 21:15:50 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 17 Jan 2004 21:15:50 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:4501 Date: 2004-01-17T16:15:49-05:00 List-Id: ka@sorry.no.email (Kenneth Almquist) writes: > Ada already has a work-around for the lack of user-defined classes: > default values for generic subprogram parameters. I that that the > way to support user defined types which act like arrays is to > (1) make array indexing be an operator, as was proposed at the start > of this thread, (2) allow user defined types to have attributes such > as 'first and 'last, and (3) allow the generic to specify that it's > parameters must support specific attributes. But isn't that too low level? I mean, array-indexing syntax makes sense for a hash table mapping strings to integers. So I should be allowed to say: if Table["begin"] = 123 then... To calculate Max, I don't want 'First and 'Last -- I want a "for each" method. - Bob