comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: comparing characters in string
Date: Sun, 05 Oct 2014 13:41:41 +0100
Date: 2014-10-05T13:41:41+01:00	[thread overview]
Message-ID: <ly38b2d6yi.fsf@pushface.org> (raw)
In-Reply-To: iEaYv.324646$DJ7.323625@fx02.iad

Shark8 <OneWingedShark@gmail.com> writes:

> On 10/5/2014 12:06 AM, Simon Wright wrote:
>> Shark8 <OneWingedShark@gmail.com> writes:
>>
>>>       function tt (a, b  : in String) return Boolean is
>>>         Target    : Character renames a(a'first);
>>>         Found     : Constant Boolean:= True;
>>>         Substring : constant String:= b(b'first+1..b'last);
>>>       begin
>>>         return (if (for some Ch of Substring => Ch = Target) then Found
>>>                 else not Found);
>>>       end tt;
>>
>> Couldn't that just be
>>
>>     function tt (a, b  : in String) return Boolean is
>>       Target    : Character renames a(a'first);
>>       Substring : constant String:= b(b'first+1..b'last);
>>     begin
>>       return (for some Ch of Substring => Ch = Target);
>>     end tt;
>>
>
> Yes, but in the original posted code the return-value was false if
> found, true if not.

Then both of us are wrong!

      reply	other threads:[~2014-10-05 12:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-04 23:03 comparing characters in string Stribor40
2014-10-05  1:41 ` Shark8
2014-10-05  7:06   ` Simon Wright
2014-10-05 12:16     ` Shark8
2014-10-05 12:41       ` Simon Wright [this message]
replies disabled

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