comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: why only in-parameters in functions
Date: Thu, 30 Sep 2004 09:41:44 +0200
Date: 2004-09-30T09:41:44+02:00	[thread overview]
Message-ID: <2gxbotroo6ys.9rx8k6ted8w2$.dlg@40tude.net> (raw)
In-Reply-To: 87oejoye2e.fsf@deneb.enyo.de

On Wed, 29 Sep 2004 23:12:41 +0200, Florian Weimer wrote:

> The "Rosen trick" is also relevant in this context (see the archives),
> but it only works for limited types.  However, it should be used
> whenever possible because it does not involve erroneous execution.

Yes. However, using Rosen trick with derived types could face problems.
When an function (primitive operation) has to be overridden, then to access
the argument to be modified, one should either cast (bad) or dispatch
(assuming that the self-pointer is class-wide.) I.e. in fact, the function
is class-wide, though declared as a primitive one. It is not good, not a
clean design.

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



  reply	other threads:[~2004-09-30  7:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-29 15:18 why only in-parameters in functions Rick Santa-Cruz
2004-09-29 15:30 ` stephane richard
2004-09-29 16:55 ` Alexander E. Kopilovich
2004-09-29 21:10   ` Randy Brukardt
2004-09-29 23:37     ` Björn Persson
2004-09-29 23:46       ` Rick Santa-Cruz
2004-09-29 21:12   ` Florian Weimer
2004-09-30  7:41     ` Dmitry A. Kazakov [this message]
2004-09-29 22:42   ` Wojtek Narczynski
2004-09-30  1:55   ` Matthew Heaney
replies disabled

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