TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
X-To: Tom Moran <[log in to unmask]>
Date: Wed, 19 Apr 2000 14:08:48 -0400
Reply-To: Steven Deller <[log in to unmask]>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"
From: Steven Deller <[log in to unmask]>
Parts/Attachments: text/plain (27 lines)
On Wednesday, April 19, 2000 1:00 PM, Tom Moran [SMTP:[log in to unmask]] wrote:
> The middle of a palindrome is also a palindrome, so one definition is:
> A zero length string is a palindrome.  Anything longer must
> have the first and last letter the same, and the in-between letters
> must be a palindrome.

So are you saying...

function Is_Palindrome (S : String) return Boolean is
    return S = "" or else
             (S (S'First) = S (S'Last) and
               Is_Palindrome (S (Natural'Succ (S'First) .. Natural'Pred
end Is_Palindrome;

"E"commerce is not life and death. If it was, it would be coded in Ada.
Steven Deller, Apex Ada Marketing
[log in to unmask], (410) 757 6924
Rational Software Corporation,
Apex email groups:
Apex technical notes: