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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,341730abd589d6e9 X-Google-Attributes: gid103376,public From: "Anders Wirzenius" Subject: Re: string operations Date: 2000/11/20 Message-ID: #1/1 X-Deja-AN: 695713131 References: <3A16A4D5.CE941970@t-online.de> <8v90vm$j5f$1@nnrp1.deja.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Trace: read2.inet.fi 974718646 194.251.142.2 (Mon, 20 Nov 2000 13:10:46 EET) Organization: Sonera corp Internet services X-MSMail-Priority: Normal NNTP-Posting-Date: Mon, 20 Nov 2000 13:10:46 EET Newsgroups: comp.lang.ada Date: 2000-11-20T00:00:00+00:00 List-Id: "Robert Dewar" wrote in message news:8v90vm$j5f$1@nnrp1.deja.com... > > ... > > Here is my favorite example of recursion, to output an integer > without worrying about its size: > > ... > > Put (Character'Val (N mod 10 + Character'Pos ('0'))); > end Print_Nat; > > I like this example since it is not simple tail recursion like I am a person studying Ada at my spare time (and, sorry, using comp.lang.ada very much as a learning source). I like your example, too. It shows both recursion and string handling, thanks for that. To me the example would have been even more revealing if the Put statement had been written Put(Character'Val(Character'Pos ('0') + N mod 10)); Anders Wirzenius