From: Jeffrey Carter <spam@spam.com>
Subject: Redefining := (was: The "()" operator revisited.)
Date: Fri, 16 Jan 2004 01:52:17 GMT
Date: 2004-01-16T01:52:17+00:00 [thread overview]
Message-ID: <ltHNb.11315$1e.3373@newsread2.news.pas.earthlink.net> (raw)
In-Reply-To: <wcczncpgjzv.fsf@shell01.TheWorld.com>
Robert A Duff wrote:
> It has to do with mutable record types (defaulted discrims).
> That's unfortunate; if you want to redefine ":=" for a non-mutable
> type, it's pretty annoying to be told you can't do that because
> mutable types exist in the language.
Could you do something like:
type Mutable (D : Natural := 0) is record
... -- whatever
end record;
type M2 is new Mutable;
procedure ":=" (To : out Mutable; From : in Mutable) is
Result : M2 (D => From.D);
procedure Assign (To : out M2; From : in M2) is
begin -- Assign
To := From;
-- You can use default ":=" with M2 because it hasn't been
-- redefined
end Assign;
begin -- ":="
-- Mess around with Result until it has what you want
Assign (To => M2 (To), From => Result);
end ":=";
?
--
Jeff Carter
"I wave my private parts at your aunties."
Monty Python & the Holy Grail
13
next prev parent reply other threads:[~2004-01-16 1:52 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-12 17:53 The "()" operator revisited Frank J. Lhota
2004-01-12 18:38 ` Frank J. Lhota
2004-01-12 22:26 ` Robert A Duff
2004-01-13 16:29 ` Frank J. Lhota
2004-01-13 9:24 ` Dmitry A. Kazakov
2004-01-13 16:44 ` Frank J. Lhota
2004-01-13 17:13 ` Hyman Rosen
2004-01-13 22:27 ` Randy Brukardt
2004-01-14 2:30 ` Stephen Leake
2004-01-14 9:04 ` Dmitry A. Kazakov
2004-01-17 0:15 ` Kenneth Almquist
2004-01-17 21:15 ` Robert A Duff
2004-01-19 10:25 ` Dmitry A. Kazakov
2004-01-13 13:13 ` Marin David Condic
2004-01-13 17:38 ` Warren W. Gay VE3WWG
2004-01-13 19:09 ` Robert A Duff
2004-01-15 17:30 ` Warren W. Gay VE3WWG
2004-01-15 18:11 ` Robert A Duff
2004-01-15 19:36 ` tmoran
2004-01-15 20:35 ` Robert A Duff
2004-01-17 5:48 ` Robert I. Eachus
2004-01-16 1:52 ` Jeffrey Carter [this message]
2004-01-16 21:37 ` Redefining := (was: The "()" operator revisited.) Randy Brukardt
2004-01-19 11:33 ` Dmitry A. Kazakov
2004-01-16 3:11 ` The "()" operator revisited Mark A. Biggar
2004-01-16 13:28 ` Hyman Rosen
2004-01-16 16:19 ` Robert A Duff
2004-01-16 18:09 ` Warren W. Gay VE3WWG
2004-01-16 13:56 ` Frank J. Lhota
2004-01-16 16:14 ` Robert A Duff
2004-01-16 21:29 ` Frank J. Lhota
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox