From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Problems with 'class, help anyone?
Date: Sat, 9 Nov 2002 19:02:53 GMT
Date: 2002-11-09T19:02:53+00:00 [thread overview]
Message-ID: <wccu1iq7ehu.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: wcc1y5wi3bw.fsf@shell01.TheWorld.com
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
> Robert A Duff wrote:
>
> > "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
> >
> >> That's right, but there is a case where "function" really differs from
> >> "procedure". I mean protected objects. ...
> >
> > That's *another* example of basing things on a kludge.
> > Certainly, it makes sense to distinguish read-only from read-write
> > locking. But to base that on "function" vs "procedure" is ...
> > well, Yuck.
>
> Absolutely
>
> > Protected functions are *not* functions (in the maths sense),
> > and therefore should not be so called.
>
> Well, strictly speaking "+" is also not the mathematical +. Who cares.
You mean because it can overflow? And because (for floats), it can give
a "close-but-wrong" answer?
Or do you mean, because the user can redefine it to do something else,
including having side effects?
>... But I
> agree that protected function is not the best name for the thing.
>
> >>... "function" vs. "procedure" for a
> >> protected object could potentially mean different implementation and
> >> performance. So I think that one should leave "function"s as they are,
> >> and just allow procedures with results:
> >>
> >> procedure Foo (...) return Bar;
> >
> > Yeah, and then eliminate the "function Foo..." syntax.
> > That would solve the problem!
> >
> > Slight incompatibility... ;-)
>
> I am not afraid of! (:-))
I can assure you that if the ARG changed the syntax in this way,
they would be tarred and feathered (or at least ignored)! ;-)
> But we still need some keywords for:
>
> 1. Subroutine (=procedure)
> 2. Subroutine with no side-effects other than on the arguments (=?)
> 3. Subroutine with only one side-effect on the result (=?)
I think 2 and 3 should use the same syntax on the declaration.
To me, it's a minor point whether a subroutine returns results
via a "function result" vs out parameter(s).
I would advocate a notation at the call site that indicates
out-parameterness.
> "function" in Ada is sort of 1. dressed as 3. (:-()
>
> {1,2,3} is multiplied to:
>
> A. Subroutine with no queue
> B. Subroutine with a queue (entry)
I am not convinced that these need a syntactic distinction.
> Well together it makes 3x2=6 different variants!
>
> And not to forget the "notation" axis:
>
> i. operational x+y
> ii. prefix (subroutines of protected objects, tasks, attributes)
I don't much like the prefix notation.
> iii. functional A(x,y)
> iv. aggregated (x,y,z) (should Ada have user-defined ones?)
I don't know about Ada, but if I were designing a language from scratch,
I think I would include user-defined aggregates. Also, user-defined
semantics for various other notations, like literals, "in", indexing,
and maybe a few others.
I would not go so far as Lisp, where you can redefine the meaning of
'if' statements, and you can even redefine the lexical rules of the
language.
- Bob
next prev parent reply other threads:[~2002-11-09 19:02 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-29 4:48 Problems with 'class, help anyone?
2002-10-29 6:08 ` Jim Rogers
2002-10-29 19:10 `
2002-10-30 5:27 `
2002-10-30 7:49 ` Simon Wright
2002-10-30 8:13 ` Jim Rogers
2002-11-02 4:02 `
2002-11-05 2:40 `
2002-11-05 4:56 ` Jim Rogers
2002-11-05 17:25 ` Stephen Leake
2002-11-05 22:29 ` Robert A Duff
2002-11-06 8:54 ` Pascal Obry
2002-11-06 15:00 ` Georg Bauhaus
2002-11-06 17:18 ` Stephen Leake
2002-11-07 14:14 ` Georg Bauhaus
2002-11-06 15:19 ` Ted Dennison
2002-11-06 17:22 ` Stephen Leake
2002-11-07 10:32 ` Preben Randhol
2002-11-07 15:53 ` Stephen Leake
2002-11-06 13:48 ` John English
2002-11-07 15:07 ` Robert A Duff
2002-11-08 9:48 ` Dmitry A. Kazakov
2002-11-08 13:44 ` Robert A Duff
2002-11-08 14:27 ` Jean-Pierre Rosen
2002-11-09 18:40 ` Dmitry A. Kazakov
2002-11-11 9:51 ` Lutz Donnerhacke
2002-11-11 13:24 ` Dmitry A. Kazakov
2002-11-11 13:55 ` Lutz Donnerhacke
2002-11-09 19:02 ` Robert A Duff [this message]
2002-11-10 17:13 ` Dmitry A. Kazakov
-- strict thread matches above, loose matches on Subject: below --
2002-11-09 0:11 Alexandre E. Kopilovitch
2002-11-11 9:03 Grein, Christoph
2002-11-11 15:12 Alexandre E. Kopilovitch
2002-11-12 12:20 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox