comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada 2005 puzzle
Date: Sun, 22 Jul 2012 11:34:54 +0200
Date: 2012-07-22T11:34:54+02:00	[thread overview]
Message-ID: <1vo4e4w755jum.1fef1su5i3sac$.dlg@40tude.net> (raw)
In-Reply-To: op.whubkrykka8ora@aspire.local

On Sun, 22 Jul 2012 13:06:17 +0400, Vasiliy Molostov wrote:

> Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> яПНяПНяПНяПНяПН(яПН) яПН яПНяПНяПНяПНяПН яПНяПНяПНяПНяПНяПН Sun,  
> 22 Jul 2012 12:19:20 +0400:
> 
>>>> Initialization does on the object's value/state.
>>>
>>> Before you told that this one converts from raw memory into well formed
>>> typed object.
>>
>> Yes. It is a type conversion: none -> a type
> 
> Since you have considered that initialisation is the same as construction,  
> I suppose you agree.

Initialization can be a part of construction. It is not same and applies to
different aspects of the object: value vs. type [+/-value].

>>> I suppose that setting up state/value of raw memory can completely  
>>> define
>>> any typed object.
>>
>> Accompanied by setting the designated type. Initialization is a part of
>> construction.
> 
> How do you setup compile-time designators in run-time?

By applying a constructor.

> "designated type"  
> is a compilation time syntax rule helping translator to distinguish type  
> of the object and which differs from source code context where used.

I don't understand this. In a typed language any object has a type.
  
> Perhaps, you tend to define type of the object outside of the memory it  
> holds.

I don't understand this either. Certainly type is a part of program
semantics and thus cannot be inside the object.

> The way Ada goes is to minimize run-time execution and memory that hold by  
> objects, via evaluating them before, e.g. in compile-time.

Objects cannot be evaluated at compile time, they are run-time entities.
Values can be. But I don't understand your point.

> Also, Ada is a procedural language.

Rather it supports procedural decomposition.

> Also, It is not clear why not to return a pointer (access reference) to  
> the object instead?

Instead of what? A pointer is an object too. As such it requires
construction. E.g. in Ada all pointers are constructed initialized by null
if not explicitly set otherwise by the programmer.

Furthermore, a pointer if not dangled, must point to an object, again
constructed.

I don't see how pointers may help the problem of construction.

Regarding limited objects, pointers usually do things only worse. You
should write instead of

    return (... some complicated not working aggregate ...);

this

   return new T'(... the same messy aggregate ...);

But in reality it might quickly become as bad as:

   return P ((S (new T'(...)).all)'Unchecked_Access);

with practically no chance to get through the compiler, even if legal.
Actually nobody, even all Ada language lawyer together, could tell if the
mess were legal or not.

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



  reply	other threads:[~2012-07-26 15:26 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-12 12:54 Ada 2005 puzzle Dmitry A. Kazakov
2012-07-12 15:48 ` Adam Beneschan
2012-07-12 16:34   ` Dmitry A. Kazakov
2012-07-19  6:53     ` Randy Brukardt
2012-07-19  7:55       ` Dmitry A. Kazakov
2012-07-20  2:22         ` Randy Brukardt
2012-07-20  7:20           ` Dmitry A. Kazakov
2012-07-21  0:04             ` Randy Brukardt
2012-07-21  8:34               ` Dmitry A. Kazakov
2012-07-24  2:38                 ` Randy Brukardt
2012-07-24  4:23                   ` Adam Beneschan
2012-07-24  7:54                     ` Dmitry A. Kazakov
2012-07-25 23:39                       ` Randy Brukardt
2012-07-26  7:41                         ` Dmitry A. Kazakov
2012-07-26 13:08                           ` Simon Wright
2012-07-26 13:55                             ` Dmitry A. Kazakov
2012-07-27  9:42                               ` AdaMagica
2012-07-27 10:32                                 ` Dmitry A. Kazakov
2012-07-27 11:58                                   ` Georg Bauhaus
2012-07-27 13:04                                     ` Dmitry A. Kazakov
2012-07-28  9:48                                       ` AdaMagica
2012-07-28 10:37                                         ` Dmitry A. Kazakov
2012-07-28 16:59                                           ` AdaMagica
2012-07-28 18:21                                             ` Dmitry A. Kazakov
2012-07-19  8:04       ` Maciej Sobczak
     [not found]         ` <juaghb$fv9$1@munin.nbi.dk>
2012-07-20  7:30           ` Dmitry A. Kazakov
2012-07-21 17:21             ` Vasiliy Molostov
2012-07-21 19:03               ` Dmitry A. Kazakov
2012-07-21 19:37                 ` Vasiliy Molostov
2012-07-21 20:23                   ` Dmitry A. Kazakov
2012-07-21 20:53                     ` Vasiliy Molostov
2012-07-22  7:41                       ` Dmitry A. Kazakov
2012-07-22  8:00                         ` Vasiliy Molostov
2012-07-22  8:19                           ` Dmitry A. Kazakov
2012-07-22  9:06                             ` Vasiliy Molostov
2012-07-22  9:34                               ` Dmitry A. Kazakov [this message]
2012-07-20  8:09           ` Maciej Sobczak
2012-07-20  8:27             ` Dmitry A. Kazakov
2012-07-20 11:30               ` Maciej Sobczak
2012-07-20 12:49                 ` Dmitry A. Kazakov
2012-07-21 22:46                   ` Maciej Sobczak
2012-07-22  8:03                     ` Dmitry A. Kazakov
2012-07-22 10:08               ` Florian Weimer
2012-07-22 11:18                 ` Dmitry A. Kazakov
2012-07-21  0:12             ` Randy Brukardt
2012-07-22  9:52       ` Florian Weimer
replies disabled

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