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.107.136.105 with SMTP id k102mr235373iod.21.1486202127757; Sat, 04 Feb 2017 01:55:27 -0800 (PST) X-Received: by 10.157.62.29 with SMTP id a29mr63766otd.5.1486202127725; Sat, 04 Feb 2017 01:55:27 -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!news.glorb.com!r185no1100498ita.0!news-out.google.com!78ni4468itm.0!nntp.google.com!r185no1100493ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 4 Feb 2017 01:55:27 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=31.48.30.72; posting-account=pmkN8QoAAAAtIhXRUfydb0SCISnwaeyg NNTP-Posting-Host: 31.48.30.72 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0fa9d98c-891f-4d18-b1ac-e6274d97dcfa@googlegroups.com> Subject: Question: Ordered Loading of an Array. From: Austin Obyrne Injection-Date: Sat, 04 Feb 2017 09:55:27 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:33240 Date: 2017-02-04T01:55:27-08:00 List-Id: My interest is in cryptography programming and I have a particular one-off = problem that readers may be able to shed some light on. I have invented a = solution that works very well but it needs to be ratified by more knowledge= able people before I would go public in a cipher program with it. Basically it involves loading on-going fallout elements as they occur in a = running program procedure (say) at run time into specifically selected cell= s of an array in a pre-ordained order, this could be the natural order of e= ach named elemnet or anything other order that is required. This discussion model here is meant to be simplistic in the extreme and it = simulates loading casually inputted code-points of ASCII(say)into a program= array in a stipulated correct order and read back later - this is just a s= hort demo being used as a discussion model. What I am doing is not normal because data is most often assigned to an arr= ay just as it occurs in consecutive order. Please take this simple model with a pinch of salt. Declarations: This_Num : Integer; SUBTYPE Index_1 IS Integer RANGE 32 .. 126; TYPE This_NumArray IS ARRAY(Index)_1 OF Integer; Cell_Num : This_NumArray:=3D (others =3D>0); Input Program: For I in 1 .. 95 Loop ; Ada.Text_IO. Put(Item =3D> "Please enter any integer in the range 32 to 126= "); Ada.Integer_Text_IO.Get (Item =3D> This_Num); Cell_Num :=3D This_Num; Cell_Num(This_Num) :=3D Cell_Num(This_Num) +1; This short loop puts each integer(This_Num) into its specifically correct c= ell and not just the next consecutive empty cell i.e. it places each intege= r into its named cell in strict order and not just any order. It will incr= ement a cell with an extra (error) element in the case of a repeat. The er= rant cell can then be trimmed correctly against the empty cell it must inev= itably leave. This is a personally devised ploy that I would like to use with impunity in= the future but I hesitate to do so because I cannot find anything in the l= anguage RM that supports it. It is a very useful tool in cryptography but = I am not prepared to use without some proof that it is reliable. I have ot= her options that I will use instead if needs be but it would be very conven= ient as a general tool if I could use this one. My gut feeling is NO. Although this ploy has never let me down I fear that it could and since I a= m not a language expert I will wait for some advice from language orientate= d people who know more about it before I use it indiscriminately. I would be very grateful to anybody who can say with conviction that it is = safe to use or not. It strikes me that the custodians of the Ada language (back at the ranch) m= ight consider adding an array loading package along such lines if it does n= ot already exist. Scr=C3=ADofa ag adacrypt