comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: String literals and wide_string literals - how?
Date: 20 Apr 2007 13:01:00 -0700
Date: 2007-04-20T13:01:00-07:00	[thread overview]
Message-ID: <1177099260.665252.323030@l77g2000hsb.googlegroups.com> (raw)
In-Reply-To: <f0b3e8$vec$1@jacob-sparre.dk>

On Apr 20, 12:16 pm, "Randy Brukardt" <r...@rrsoftware.com> wrote:

> Now throw in some operator overloading:
>
>     function "+" (Left, Right : Roman_Numeral) return Roman_Numeral;
>
> and you can work solely in Roman_Numerals.

It would be an interesting challenge to write this function---without
cheating.  That is, without resorting to converting the operands to
regular integers, adding them the normal way, and converting the
result back.  No, no, no.  Do it the way the Romans would have had to
do it.  Might make for a good programming exercise.

And then, if someone gets this right, tell them to implement "*".


>     Total : constant Roman_Numeral := Claw_Generic_Price +
> Claw_Support_Price;
>
> Cool, even if rather useless. (I don't think I'd want to try to calculate
> sales tax this way!!)

Given that a lot of people had to calculate a lot of taxes this past
week, I'm sure they're all thankful that they didn't have to fill out
Form MXL this way.

                                         -- Adam






  reply	other threads:[~2007-04-20 20:01 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-20 10:07 String literals and wide_string literals - how? Gerd
2007-04-20 14:33 ` Adam Beneschan
2007-04-20 14:55 ` Robert A Duff
2007-04-20 19:16   ` Randy Brukardt
2007-04-20 20:01     ` Adam Beneschan [this message]
2007-04-20 20:41       ` Dmitry A. Kazakov
2007-04-20 20:02     ` Robert A Duff
2007-05-21  2:33       ` David Thompson
2007-05-22 22:32         ` Randy Brukardt
2007-05-23 18:42           ` Jeffrey R. Carter
     [not found]             ` <f324h5$fna$1@f04n12.cac.psu.edu>
2007-05-24 21:15               ` Jeffrey R. Carter
2007-05-23  2:27         ` Keith Thompson
2007-07-01  1:00           ` David Thompson
2007-05-23 12:28         ` brian.b.mcguinness
2007-04-20 20:48     ` Dmitry A. Kazakov
2007-04-20 22:09   ` Jeffrey R. Carter
2007-04-21  9:41     ` Simon Wright
2007-04-22  0:35       ` Jeffrey R. Carter
2007-04-22  9:45         ` Simon Wright
2007-04-22 20:15           ` Jeffrey R. Carter
2007-04-22 21:18             ` Simon Wright
2007-04-23  1:44               ` Jeffrey R. Carter
2007-04-22  1:00     ` Robert A Duff
2007-04-20 14:58 ` Georg Bauhaus
replies disabled

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