comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <nickroberts@callnetuk.com>
Subject: Re: "Moving" objects of limited type
Date: 2000/06/04
Date: 2000-06-04T00:00:00+00:00	[thread overview]
Message-ID: <8he565$2u7fc$1@fu-berlin.de> (raw)
In-Reply-To: 87wvk6xz5p.fsf@deneb.cygnus.argh.org

I would suggest:

   procedure Transfer (From, To: in out Object_Type) [is abstract];

If you are worried that the word 'transfer' might be interpreted as meaning
'swap', you could use the parameter names to counteract this, e.g.:

   ...
   Saved_Text := Working_Text; -- makes copy
   Beautify(Working_Text);
   if not User_Agrees then
      Transfer(From => Saved_Text, To => Working_Text);
   else
      Saved_Text := Empty_Text; -- deletes
      ...

It is perhaps curious to note how this example could be interpreted as a
demonstration of how 'ugly'* the classic ":=" assignment notation is.
(Personally, I find ":=" too readable to be so condemned. If nothing else,
it helps break up the code.)**

--
Nick Roberts
http://www.adapower.com/lab/adaos

*e.g. inconsistent with the general form of procedure call

**Reading Pascal Obry's reply, I would sometimes find whole pages of Cobol
(in OFPC***) consisting entirely of MOVEs, in times gone by. Nobody had
taught them MOVE CORRESPONDING. Sad.

***Other Funny Programmers' Code


"Florian Weimer" <fw@deneb.cygnus.argh.org> wrote in message
news:87wvk6xz5p.fsf@deneb.cygnus.argh.org...

> ...
> Now my question: What's an appropriate name for such an operation?
> "Move", "Relocate", "Rename", "Teleport"?  Maybe this operation is
> quite common, and in this case I want to use the correct term.






  reply	other threads:[~2000-06-04  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-03  0:00 "Moving" objects of limited type Florian Weimer
2000-06-04  0:00 ` Nick Roberts [this message]
2000-06-04  0:00 ` Pascal Obry
2000-06-05  0:00 ` Marin D. Condic
replies disabled

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