comp.lang.ada
 help / color / mirror / Atom feed
From: 18k11tm001@sneakemail.com (Russ)
Subject: Re: user-defined type conversion
Date: 21 May 2002 21:32:56 -0700
Date: 2002-05-22T04:32:56+00:00	[thread overview]
Message-ID: <bebbba07.0205212032.357b1059@posting.google.com> (raw)
In-Reply-To: bebbba07.0205201126.572c9f09@posting.google.com

18k11tm001@sneakemail.com (Russ) wrote in message news:<bebbba07.0205201126.572c9f09@posting.google.com>...
> "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com> wrote in message news:<mailman.1021892102.6644.comp.lang.ada@ada.eu.org>...
> > ----- Original Message ----- 
> > From: "Russ" <18k11tm001@sneakemail.com>
> > Newsgroups: comp.lang.ada
> > To: <comp.lang.ada@ada.eu.org>
> > Sent: May 19, 2002 10:25 PM
> > Subject: Re: user-defined type conversion
> > 
> > > I still don't see why I shouldn't be able to make my own type/unit
> > > conversion that has the same simple syntax as the built-in type
> > > conversions. Until I do, I consider it a minor deficiency of the
> > > language.
> > Do you understand now?
> 
> Yes, I understand now. But I think Ada should have been designed to
> first check for a user-defined type conversion before using a
> compiler-generated conversion. That would solve the ambiguity problem
> and allow users to create their own type/unit conversions with the
> same syntax as built-in type conversions. That, in turn, would allow
> developers to create simple and elegant type/unit system for each
> particular application.

After reading the replies here and thinking about it a bit more, I
have come to the conclusion that it is not such a great idea after all
to have user-defined type conversions with the same syntax as built-in
conversions.

The problem is that it is error prone. I could carelessly try to
invoke my user-defined conversion on a type that I have not defined it
for, and the compiler would not be able to detect the error (because
it would just use the built-in conversion).

There's hope for me after all.



      parent reply	other threads:[~2002-05-22  4:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]
replies disabled

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