comp.lang.ada
 help / color / mirror / Atom feed
From: sk <sk@noname.com>
To: "comp.lang.ada mail to news gateway" <comp.lang.ada@ada.eu.org>
Subject: Re: C code to Ada
Date: Thu, 23 Jan 2003 02:00:33 -0600
Date: 2003-01-23T02:00:33-06:00	[thread overview]
Message-ID: <mailman.20.1043308655.4961.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: GqXW9.4012$7Z3.107109@newsfep1-gui.server.ntli.net

Hi,

 > Personally I think "dummies" should be doing bindings

I am trying to give up being clever, I always end up with
messes like my original post and, as noted by another
poster, the quick part takes longer than doing it the
dummy way :-)

However, at 2am in the morning, waiting for gcc to
compile, I cannot resist ...

For the entity with the usenetonym of "chris.danx" :

     Whoops    : exception;

     function "+"(A, B : Character) return Character is
         type Byte is mod 2**8;
     begin
         return Character'Val (
             Byte(Character'Pos(A)) +
             Byte(Character'Pos(B)) -
             Byte(Character'Pos(' '))
         );
     end "+";

     function "+"(S1, S2 : String) return String is
        Result  : String (1 .. S1'Length) := (Others => ' ');
     begin
         if S1'Length /= S2'Length then
             raise Whoops;
         end if;

         for C in Result'Range loop
             Result (C) := S1(C) + S2(C);
         end loop;

         return Result;
     end "+";

... and of course when I stumble across this code two
months from now, I will be totally lost wondering why
on earth I wanted to add two characters together and
subtract a space ? I dare not speculate at the results
other than for decoding my e-mail address :-)

(chris.danx : I e-mailed you, don't know if I got *your*
address correct).

-- 
--
-- Merge vertically for real address
--
------------------------------------
-- s n p @ t . o
--  k i e k c c m
------------------------------------




  parent reply	other threads:[~2003-01-23  8:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-20 18:44 C code to Ada chris.danx
2003-01-20 21:33 ` sk
2003-01-20 21:43   ` chris.danx
2003-01-20 22:56     ` James S. Rogers
2003-01-20 23:05       ` chris.danx
2003-01-21  2:17       ` Jeffrey Carter
2003-01-20 23:32     ` sk
2003-01-21  0:56       ` chris.danx
2003-01-21  1:26         ` sk
2003-01-21 15:49           ` Frank J. Lhota
2003-01-22  1:05           ` chris.danx
2003-01-21  2:27   ` Jeffrey Carter
2003-01-21  2:55     ` sk
2003-01-21 19:33       ` Jeffrey Carter
2003-01-21  6:18     ` Simon Wright
     [not found] ` <3E2C6B2B.5090600@noname.com>
2003-01-20 21:39   ` sk
2003-01-21  1:23 ` sk
2003-01-25 21:28   ` chris.danx
2003-01-26  2:16     ` sk
2003-01-26  3:04     ` sk
     [not found]     ` <3E33502D.7030503@noname.com>
2003-01-26  5:37       ` sk
2003-01-23  8:00 ` sk [this message]
2003-01-24 18:03   ` chris.danx
replies disabled

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