comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada-Singleton-Why does it work like this?
Date: Thu, 26 Mar 2009 15:28:46 +0100
Date: 2009-03-26T15:28:46+01:00	[thread overview]
Message-ID: <18883tufqaunz.gf51zy6m6gna$.dlg@40tude.net> (raw)
In-Reply-To: adbbc069-28f5-4174-8178-d0154c717717@g19g2000yql.googlegroups.com

On Thu, 26 Mar 2009 06:39:26 -0700 (PDT), Maciej Sobczak wrote:

> On 26 Mar, 10:28, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> wrote:
> 
>> This highlights the point. "Singletonness" is not a property of the type
>> used to implement it.
> 
> Depends. The type involves not only the set of possible states, but
> also the set of possible operations. Is the creation as an operation
> part of this set?

No, creation is not an operation.

Operations are defined on values. A singleton is a variable that can take
different values changed by applying corresponding operations. The property
of being singleton is one of the variable (object).

> Can you defend the idea that creation does not belong to the type?

I think I can. Creation cannot be expressed in terms of values of the type.
As an example consider integer. There is no integer operation that creates
values. In fact, integer values exist outside the program, they always
existed before and will exist after any program being written or run.
Obviously + does not create a new 4 when 2 is added to 2. Similarly, there
is no integer subprogram that creates an integer object (like a variable).
That is a prerogative of the compiler which inserts some magic object
creation stuff as necessary. This thing is called "constructor." Functions
are not constructors, they return "existing" objects. Even newly introduced
Pickwickian functions in Ada 2005 do so. That's why return-statement was
invented.

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



  parent reply	other threads:[~2009-03-26 14:28 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-24 19:01 Ada-Singleton-Why does it work like this? patrick.gunia
2009-03-24 19:10 ` Pascal Obry
2009-03-24 20:47 ` Jeffrey R. Carter
2009-03-25  0:10   ` Martin
2009-03-25  0:41     ` Jeffrey R. Carter
2009-03-25  9:30     ` Dmitry A. Kazakov
2009-03-26  8:55       ` Martin
2009-03-26  9:28         ` Dmitry A. Kazakov
2009-03-26 13:39           ` Maciej Sobczak
2009-03-26 14:07             ` Georg Bauhaus
2009-03-26 14:33               ` Dmitry A. Kazakov
2009-03-26 15:22                 ` Georg Bauhaus
2009-03-26 16:31                   ` Dmitry A. Kazakov
2009-03-26 14:28             ` Dmitry A. Kazakov [this message]
2009-03-26 22:00               ` Maciej Sobczak
2009-03-27 10:02                 ` Dmitry A. Kazakov
2009-03-25 22:29   ` sjw
2009-03-24 20:52 ` Ludovic Brenta
2009-03-25  9:59   ` patrick.gunia
2009-03-25 10:29     ` Jean-Pierre Rosen
2009-03-25 11:26     ` Georg Bauhaus
2009-03-25 11:49       ` patrick.gunia
2009-03-29  7:29     ` Jacob Sparre Andersen
2009-03-24 21:21 ` Dmitry A. Kazakov
2009-03-25 10:07   ` patrick.gunia
2009-03-25 10:57     ` patrick.gunia
2009-03-25 11:40       ` Georg Bauhaus
2009-03-25 11:46       ` Ludovic Brenta
2009-03-25 11:55         ` patrick.gunia
2009-03-25 14:10         ` patrick.gunia
2009-03-25 14:40           ` Ludovic Brenta
2009-03-25 15:16             ` Adam Beneschan
2009-03-25 15:19             ` patrick.gunia
2009-03-25 16:52               ` Georg Bauhaus
2009-03-25 11:10     ` Dmitry A. Kazakov
2009-03-25 11:37       ` patrick.gunia
2009-03-25 12:07         ` Ludovic Brenta
2009-03-25 15:00         ` Robert A Duff
2009-03-25 11:17     ` Jean-Pierre Rosen
2009-03-26  9:04       ` Martin
2009-03-25 11:38     ` 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