comp.lang.ada
 help / color / mirror / Atom feed
* I wish I could ...
@ 2004-09-16 18:11 Björn Persson
  2004-09-16 18:20 ` Frank J. Lhota
  2004-09-17  7:28 ` Jeffrey Carter
  0 siblings, 2 replies; 4+ messages in thread
From: Björn Persson @ 2004-09-16 18:11 UTC (permalink / 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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-09-17  7:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-16 18:11 I wish I could Björn Persson
2004-09-16 18:20 ` Frank J. Lhota
2004-09-16 19:04   ` Björn Persson
2004-09-17  7:28 ` Jeffrey Carter

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