comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@schonberg.cs.nyu.edu (Robert Dewar)
Subject: Re: Redefinition of Equality (Long)
Date: 1996/09/29
Date: 1996-09-29T00:00:00+00:00	[thread overview]
Message-ID: <dewar.844021156@schonberg> (raw)
In-Reply-To: DyHzHy.5qA@world.std.com


Bob said

"In article <52hgmoINN7tg@snoopy.cis.ohio-state.edu>,
david scott gibson <dgibson@snoopy.cis.ohio-state.edu> wrote:
>In order to compare the elements from two sets, a redefined equality
>function must remove elements from the sets first. ...

It seems highly undesirable for "=" to modify its parameters.  If you
want to implement "=" in terms of some destructive operations, then you
ought to make a copyof the parameters first.  Why is this a problem?

I certainly agree that functions should allow 'in out' parameters, but
not so you can write evil "=" operations.  But even if 'in out' were
allowed, you would still have your problem, because for *tagged* types
an overriding operation has to be subtype conformant with what it's
overriding.
"


I completely agree with Bob here. In fact it is this kind of suggestion
of serious misuse of the ability to have in out parameters for functions
that feeds the enthusiasim of the rabid anti-side-effects-in-functions
folks :-)

Actually as we have discussed this issue over and over again, more and more
such horrible proposed uses have appeared, and although I still wish that
this very annnoying restrictions would have been lifted at LEAST for
interfaced functions, where the ability is really important, I must say
that I have to agree more than I did that this capability invites misuse.

Bob's analysis of why this feature did NOT go in is quite right. In fact
the requirements document (of which i was one of the authors) casually
mentioned the relaxation of this restriction as a *possible* example
of what we meant by stating the priniciple that unenecessary and 
undesirable restrictions should be removed.

A majority of all comments received on the requirements document were
rants and raves about even the *suggestion* that this restriction should
be dropped :-)





  reply	other threads:[~1996-09-29  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-27  0:00 Redefinition of Equality (Long) david scott gibson
1996-09-29  0:00 ` Robert A Duff
1996-09-29  0:00   ` Robert Dewar [this message]
1996-09-30  0:00   ` Dave Gibson
1996-09-30  0:00     ` Robert A Duff
1996-10-02  0:00       ` Robb Nebbe
1996-10-04  0:00       ` Redefinition of Equality david scott gibson
1996-10-04  0:00       ` Redefinition of Equality (Long) Kenneth Almquist
1996-10-04  0:00         ` david scott gibson
1996-10-07  0:00           ` Kenneth Almquist
replies disabled

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