comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Persson" <spam-away@nowhere.nil>
Subject: I wish I could ...
Date: Thu, 16 Sep 2004 18:11:56 GMT
Date: 2004-09-16T18:11:56+00:00	[thread overview]
Message-ID: <MHk2d.3400$d5.26018@newsb.telia.net> (raw)

Right now I'm writing code like this in several places:

    case Going is
       when Forward =>
          for Pos in 1 .. Source.Last loop
             if Source.Reference.all (Pos) /= Character'Pos(Space) then
                return Pos;
             end if;
          end loop;
       when Backward =>
          for Pos in reverse 1 .. Source.Last loop
             if Source.Reference.all (Pos) /= Character'Pos(Space) then
                return Pos;
             end if;
          end loop;
    end case;

I wish I could just write:

    for Pos in Going 1 .. Source.Last loop
       if Source.Reference.all (Pos) /= Character'Pos(Space) then
          return Pos;
       end if;
    end loop;

-- 
Björn Persson                              PGP key A88682FD
                    omb jor ers @sv ge.
                    r o.b n.p son eri nu




             reply	other threads:[~2004-09-16 18:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-16 18:11 Björn Persson [this message]
2004-09-16 18:20 ` I wish I could Frank J. Lhota
2004-09-16 19:04   ` Björn Persson
2004-09-17  7:28 ` Jeffrey Carter
replies disabled

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