Sujet : Re: How can I make Reduce run from right to left?
De : spam.jrcarter.not (at) *nospam* spam.acm.org.not (Jeffrey R.Carter)
Groupes : comp.lang.adaDate : 10. Dec 2024, 22:04:02
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vjaac2$14kbd$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
On 2024-12-10 18:20, Brian9000 wrote:
Ada.Text_IO.Put_Line (Real'Image ([ for i in reverse 0 .. data'Last -
1 => data(i) ]'Reduce("-", data(data'Last))));
Presumably you could do
[for I in 0 .. Data'Last - 1 => Data (Data'Last - 1 - I)]'Reduce
Or write a Reverse function
Reverse (Data (0 .. Data'Last - 1) )'Reduce
-- Jeff Carter"An essential part of teaching Ada is notthe technical details, but the message ofsoftware engineering."Jean-Pierre Rosen
167