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: a07f3367d7,bf03d731a6ef511f X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!xmission!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Copying rows in a two dimensional array. Date: Mon, 08 Feb 2010 16:20:29 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <12ezqn0wq0lmm$.s7nr5aueiwa4$.dlg@40tude.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1265664015 5947 192.74.137.71 (8 Feb 2010 21:20:15 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 8 Feb 2010 21:20:15 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:MhPVK7CBcOZCGY7wHGPniqRQgEA= Xref: g2news1.google.com comp.lang.ada:8998 Date: 2010-02-08T16:20:29-05:00 List-Id: "Dmitry A. Kazakov" writes: > On Mon, 08 Feb 2010 08:15:50 -0500, Robert A Duff wrote: > >> Actually, slices are one of the least useful features of Ada. >> I wouldn't mind (much) if they didn't exist in the first place. > > But only if the language provided means to have user-defined ones. I'm all in favor of allowing users to define their own abstractions, rather than trying to build-in lots of stuff into the language. .... Which is > far from trivial. It's trivial if you only want slices as R-values. And anyway, slices as L-values don't really work: X : String := "abc"; X (2..2) := "xxx"; One might expect X = "axxxc", but of course it raises an exception instead. You can do that sort of thing in Ada with unbounded strings -- but then you don't get slice syntax! >...You need a lot of related types to describe slices > themselves and indicator sets (ranges). Plus you have to provide means to > determine if subarrays overlap in order to implement assignment in a safe > way. And user-defined assignment itself need to be properly done (syntax, > referential semantics of function results etc.) - Bob