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 08:06:18 +0100
Date: 2014-10-05T08:06:18+01:00	[thread overview]
Message-ID: <ly7g0fc7x1.fsf@pushface.org> (raw)
In-Reply-To: lr0Yv.437953$O13.137119@fx17.iad

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;


  reply	other threads:[~2014-10-05  7:06 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 [this message]
2014-10-05 12:16     ` Shark8
2014-10-05 12:41       ` Simon Wright
replies disabled

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