comp.lang.ada
 help / color / mirror / Atom feed
From: billwolf@hubcap.clemson.edu (William Thomas Wolfe,2847,)
Subject: Re: Overloading of assignment
Date: 26 Nov 88 19:59:37 GMT	[thread overview]
Message-ID: <3667@hubcap.UUCP> (raw)
In-Reply-To: 881125130910.218003ab@elcc.epfl.ch

From article <881125130910.218003ab@elcc.epfl.ch>, by madmats@elma.epfl.ch (Mats Weber):
! Consider the following example:
! 
#    package ADT is
#       type T is limited private;
#       procedure ":=" (OBJECT : in out T; VALUE : in T);
$       function TO_T (N : INTEGER) return T;
$    private
$       type T is range 0..1000;
%    end ADT;
% 
%    with ADT; use ADT;
&    procedure P is
&       X : ADT.T;
*    begin
*       X := TO_T(7);    -- this call of ":=" is erroneous because X
*    end P;              -- is undefined.

 The solution is to enable any type of object to be automatically initialized;
 any type of object should be able to carry the value "undefined", which is
 automatically assumed by all objects not otherwise initialized.  

 The value "null" would be an alias for "undefined", to preserve compatibility.

 In the case of integers, for example, we typically have the range
    31    31                            31        31
  -2  .. 2  - 1; this would shrink to -2  - 1 .. 2  - 1, using the
                      31
 liberated value of -2  as our representation of "undefined", and
 rendering the range of an integer symmetrical, thus eliminating
 the problem of having -1 * MAXINT raise a NUMERIC_ERROR.

  reply	other threads:[~1988-11-26 19:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1988-11-25 12:09 Overloading of assignment Mats Weber
1988-11-26 19:59 ` William Thomas Wolfe,2847, [this message]
1988-11-26 20:10   ` William Thomas Wolfe,2847,
1988-11-29 16:01   ` Stephe Leake
replies disabled

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