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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.99.113.76 with SMTP id b12mr774801pgn.162.1485437385163; Thu, 26 Jan 2017 05:29:45 -0800 (PST) X-Received: by 10.157.44.136 with SMTP id p8mr92077otb.20.1485437385107; Thu, 26 Jan 2017 05:29:45 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!2.eu.feeder.erje.net!feeder.erje.net!2.us.feeder.erje.net!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder1.iad1.usenetexpress.com!216.166.98.84.MISMATCH!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!r185no381120ita.0!news-out.google.com!78ni8675itm.0!nntp.google.com!r185no383318ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 26 Jan 2017 05:29:44 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a02:c7d:3cda:7600:932b:b705:6315:5a80; posting-account=L2-UcQkAAAAfd_BqbeNHs3XeM0jTXloS NNTP-Posting-Host: 2a02:c7d:3cda:7600:932b:b705:6315:5a80 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: REQ: Extend slices for n dimensional arrays for Ada 202X From: Lucretia Injection-Date: Thu, 26 Jan 2017 13:29:45 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:33174 Date: 2017-01-26T05:29:44-08:00 List-Id: Hi, Array slices are a very powerful feature of the language as it is right now= , but the fact that they are limited to 1-dimensional arrays if short sight= ed. By having slices be applicable to all types of arrays would make memory= copy operations much easier to do and would also eliminate possible array = index calculation errors that we see in other languages. Example: When using my SDL bindings I would like to be able to copy a texture or sub= -texture, be that 1D, 2D or 3D, from one texture to an area within another = texture. As an example, this would be perfect for implementing a movie play= er, decode frame into buffer, e.g. Texture (x1 .. x2, y1 .. y2) :=3D Buffer; -- Buffer is the correct size= . Because these would be primitive types, there would be no way to provide an= alternative copy operation which doesn't use the CPU, so I would suggest a= new attribute to allow for this: for Texture_Type'Copy use GPU_Copy; where GPU_Copy could be defined as: procedure GPU_Copy (Source : in out Texture_Type; Dest : in Texture_Type)= ; This is not just useful for games which can get quite low-level as can be s= een, it could be used to implement DMA copying on an embedded system, or of= floading to another MCU on the board. Another point is that this could open Ada up even more into new areas of wo= rk, such as games.=20 Luke.