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=-0.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.kamp.net!newsfeed.kamp.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.83.MISMATCH!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!news.stack.nl!aioe.org!.POSTED!not-for-mail From: anon@att.net Newsgroups: comp.lang.ada Subject: Re: An optimizing compiler idea Date: Fri, 4 Jul 2014 22:26:59 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: Reply-To: anon@att.net NNTP-Posting-Host: Xnrs/nU3wMUAOWPrsZLoKg.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: IBM NewsReader/2 2.0 Xref: number.nntp.dca.giganews.com comp.lang.ada:187366 Date: 2014-07-04T22:26:59+00:00 List-Id: This concept has been used around since the begining Ada 83. In , Victor Porton writes: >In this post I ask whether my idea is not new and already implemented. And >also I suggest to implement it in Ada compilers. > >I propose not to store an array bound if it is constant (1 in the example >below). > >This can be used to create container types which could be more efficient >than plain arrays. > >Below is a toy container type giving an example of my idea: > >package Test is > > type Test_Array_Type is array(Integer range <>) of Float; > > type Test_Record(Size: Integer) is > record > Test_Array: Test_Array_Type(1..Size); > end record; > >end; > >In this example we can store only one (upper) index of an array. Thus it >could be faster and more memory efficient than plain array with a range of >two indexes. > >-- >Victor Porton - http://portonvictor.org