From: Ted Dennison <dennison@telepath.com>
Subject: Re: Abstract null value
Date: Thu, 08 Feb 2001 15:17:32 GMT
Date: 2001-02-08T15:17:32+00:00 [thread overview]
Message-ID: <95uda1$pq6$1@nnrp1.deja.com> (raw)
In-Reply-To: 95sgl4$3c8$2@wanadoo.fr
In article <95sgl4$3c8$2@wanadoo.fr>,
"Jean-Pierre Rosen" <rosen.adalog@wanadoo.fr> wrote:
> Sometimes, the constructor is not able to perform the job, and you
> want to return some "null value" (I know, you can also raise an
...
> package Abstract_Type is
> type Root_Type is abstract tagged null record;
> procedure Oper (X : Root_Type) is abstract;
>
> Null_Value : constant Root_Type'Class;
For this system to work, all your "constructors" would have to be
functions returning something like Root_Type'Class, and their targets
would all have to be class-wide initializations or allocators, right? Or
is that some kind of unwritten standard of which I'm unaware? A slim
majority of the time when I'm "constructing" a tagged type object
there's a specific type the expression is expecting. If I were to do
that with the above system, then I'd just get Constraint_Error.
--
T.E.D.
http://www.telepath.com/~dennison/Ted/TED.html
Sent via Deja.com
http://www.deja.com/
next prev parent reply other threads:[~2001-02-08 15:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-07 18:56 Abstract null value Jean-Pierre Rosen
2001-02-08 15:17 ` Ted Dennison [this message]
2001-02-08 18:24 ` Jean-Pierre Rosen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox