comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: The simple Image issue
Date: Wed, 31 Aug 2011 18:26:13 +0200
Date: 2011-08-31T18:26:13+02:00	[thread overview]
Message-ID: <axt8xx2u907c$.1of6qjwtf2dx1$.dlg@40tude.net> (raw)
In-Reply-To: m27h5tftrg.fsf@pushface.org

On Wed, 31 Aug 2011 17:08:51 +0100, Simon Wright wrote:

> Hyman Rosen <hyrosen@mail.com> writes:
> 
>> On 8/31/2011 2:16 AM, Georg Bauhaus wrote:
>>> In which way would you change T'Value for symmetry?
>>
>> You wouldn't, because the symmetry is false. When you
>> already have an object, being forced to name its type
>> is silly and redundant. When you have a string and want
>> it converted to an object, of course you need to say
>> what type it's becoming.
> 
> I would have thought overload resolution would solve a lot of problems?
> 
>    X : Integer := "123"'Value;
>    Y : Float := "1.0e-9"'Value;

Yes, in my string editing library, it is just overloaded functions:

   X : Integer := Value ("123");
   Y : Float := Value ("1.0e-9");

No problem to resolve. The real problem is that the thing is generic. A
built-in function does not need boring instantiations.

P.S. There exist subtle issues with subtypes, e.g. 

   X : Positive := Value ("-123");

The question is whether the constraint has to be known within the operation
or not. In most cases the operation can operate on the parent checking the
constraint upon setting the target:

   Positive's Value = Positive o Integer's Value

But for things like enumeration extensions (i.e. subtypes weakening
constraints rather than strengthening them), this would become a problem.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2011-08-31 16:26 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29 15:46 Address and bit mask milouz
2011-08-29 16:06 ` Martin
2011-08-29 16:33   ` milouz
2011-08-29 17:47     ` Dmitry A. Kazakov
2011-08-29 17:54     ` Martin
2011-08-29 18:46     ` tmoran
2011-08-29 19:41 ` Ludovic Brenta
2011-08-29 19:54   ` Adam Beneschan
2011-08-30  9:14     ` milouz
2011-08-30 10:34       ` Ludovic Brenta
2011-08-30 10:58         ` Ludovic Brenta
2011-08-30 12:44           ` Georg Bauhaus
2011-08-30 14:04             ` Dmitry A. Kazakov
2011-08-30 16:12               ` Georg Bauhaus
2011-08-30 16:59                 ` Dmitry A. Kazakov
2011-08-30 14:52         ` Adam Beneschan
2011-08-30 10:40       ` Simon Wright
2011-08-30 10:44         ` Simon Wright
2011-08-30 15:20         ` tmoran
2011-08-30 16:08           ` milouz
2011-08-30 16:45             ` Georg Bauhaus
2011-08-30 19:31               ` Adam Beneschan
2011-08-30 19:56                 ` Dmitry A. Kazakov
2011-08-31  6:16                   ` The simple Image issue (was: Address and bit mask) Georg Bauhaus
2011-08-31 14:44                     ` The simple Image issue Dmitry A. Kazakov
2011-08-31 15:36                       ` Georg Bauhaus
2011-08-31 15:53                         ` Dmitry A. Kazakov
2011-08-31 16:23                           ` Georg Bauhaus
2011-08-31 16:27                             ` Dmitry A. Kazakov
2011-08-31 16:30                               ` Georg Bauhaus
2011-08-31 16:50                                 ` Dmitry A. Kazakov
2011-08-31 20:41                                   ` Georg Bauhaus
2011-08-31 21:17                                     ` Robert A Duff
2011-09-01  7:36                                       ` Dmitry A. Kazakov
2011-09-01  7:46                                     ` Dmitry A. Kazakov
2011-09-01  9:50                                       ` Overloading parentheses and type expectations (was: The simple Image issue) Georg Bauhaus
2011-09-02  7:54                                         ` Overloading parentheses and type expectations Dmitry A. Kazakov
2011-09-02 10:37                                           ` Georg Bauhaus
2011-09-02 12:40                                             ` Dmitry A. Kazakov
2011-09-02 16:08                                               ` Georg Bauhaus
2011-09-02 17:29                                                 ` Dmitry A. Kazakov
2011-08-31 15:53                     ` The simple Image issue Hyman Rosen
2011-08-31 16:07                       ` Dmitry A. Kazakov
2011-08-31 16:08                       ` Simon Wright
2011-08-31 16:26                         ` Dmitry A. Kazakov [this message]
2011-08-31 16:25                       ` Georg Bauhaus
2011-08-31 16:30                         ` Hyman Rosen
2011-08-31 16:34                           ` Georg Bauhaus
2011-08-31 16:43                             ` Adam Beneschan
2011-08-31 21:58                               ` Georg Bauhaus
2011-09-01  7:59                                 ` Dmitry A. Kazakov
2011-08-31 16:08                     ` The simple Image issue (was: Address and bit mask) Adam Beneschan
2011-08-31 16:53                       ` The simple Image issue Simon Wright
2011-08-31 17:02                         ` Hyman Rosen
2011-08-31 20:33                       ` Georg Bauhaus
2011-08-30 19:37             ` Address and bit mask Martin
2011-08-30 16:32           ` Simon Wright
2011-08-31  7:55             ` Ludovic Brenta
2011-08-30 12:35       ` Georg Bauhaus
2011-08-30 13:03       ` Georg Bauhaus
2011-08-30 15:14       ` Adam Beneschan
2011-08-30 15:59         ` Adam Beneschan
2011-08-31  7:45         ` milouz
2011-08-31  8:35           ` Ludovic Brenta
replies disabled

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