comp.lang.ada
 help / color / mirror / Atom feed
* user-defined type conversion
@ 2002-05-19  7:44 Russ
  2002-05-19  8:54 ` martin.m.dowie
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Russ @ 2002-05-19  7:44 UTC (permalink / raw)


I am experimenting with a simple type system for physical units.
Suppose, for example, I have types for inches and feet, and I wish to
write an explicit conversion:

type inches is new float;
type feet is new float;

function inches ( arg: feet ) return inches is
    begin
    return inches ( 12.0 * float(feet) );
    end inches;

The problem is that I am not allowed to use the name inches for the
conversion function because it is already used for the type name. It
seems that the name should be overloadable for both the type and the
conversion function. Is there any way around this?



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

end of thread, other threads:[~2002-05-22  4:32 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-19  7:44 user-defined type conversion Russ
2002-05-19  8:54 ` martin.m.dowie
2002-05-19 10:44 ` David C. Hoos, Sr.
2002-05-19 18:29   ` Russ
2002-05-19 20:58     ` David C. Hoos, Sr.
2002-05-19 21:12     ` Jeffrey Carter
2002-05-21  9:18       ` Dmitry A. Kazakov
2002-05-19 19:01 ` sk
2002-05-20  3:33   ` Russ
2002-05-20 19:27     ` Randy Brukardt
2002-05-20 19:45       ` David C. Hoos
2002-05-19 21:17 ` Jeffrey Carter
2002-05-20  3:25   ` Russ
2002-05-20  6:21     ` Jeffrey Carter
2002-05-21  9:30       ` Dmitry A. Kazakov
     [not found]     ` <mailman.1021892102.6644.comp.lang.ada@ada.eu.org>
2002-05-20 19:26       ` Russ
2002-05-21  9:35         ` Dmitry A. Kazakov
2002-05-22  4:32         ` Russ

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