comp.lang.ada
 help / color / mirror / Atom feed
From: "Anders Wirzenius" <anders.wirzenius@pp.qnet.fi>
Subject: Re: string operations
Date: 2000/11/20
Date: 2000-11-20T00:00:00+00:00	[thread overview]
Message-ID: <WE7S5.239$rj6.8595@read2.inet.fi> (raw)
In-Reply-To: 8v90vm$j5f$1@nnrp1.deja.com

"Robert Dewar" <robert_dewar@my-deja.com> 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






  reply	other threads:[~2000-11-20  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-18  0:00 string operations Margit Gut
2000-11-18  0:00 ` Jeff Carter
2000-11-19  0:00 ` Robert Dewar
2000-11-20  0:00   ` Anders Wirzenius [this message]
2000-11-20  0:00     ` Robert Dewar
2000-11-21  6:30       ` Anders Wirzenius
2000-11-24  0:00         ` Margit Gut
2000-11-24  0:00         ` Margit Gut
  -- strict thread matches above, loose matches on Subject: below --
2000-11-24  0:00 String operations Margit Gut
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox