comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: A bunch of questions that come after "Hello world"
Date: Fri, 15 Nov 2002 23:07:28 GMT
Date: 2002-11-15T23:07:28+00:00	[thread overview]
Message-ID: <wcc7kfe8ma7.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 5ad0dd8a.0211150950.4d550163@posting.google.com

wojtek@power.com.pl (Wojtek Narczynski) writes:

> I't just that protected type, task type and record type are all
> composite types, and you can put a function or procedure inside a
> protected or task type, but you cannot do this inside a record. So you
> sometimes declare them outside and sometimes inside. Don't you find it
> it's weird?

Yes.  If I were designing the whole language from scratch, I would put
them all *outside*, including the protected type case.  (I would also
eliminate task entries, so the issue would not arise there.)

Part of the reason for these things is history.  Ada tasks were
originally just tasks -- there were no task types.  Similar to the way
packages are not "objects" -- there are no "package types".  This was
around 1980 or so.  Task types were added before the 1983 standard.
Protected types (added in Ada 95) were somewhat modeled after tasks,
and so inherited some of the oddities.

>...Thought that maybe I am missing something. Dynamic
> dispatch on multiple attributes is the reason I got interested in Ada,
> but still putting a function inside a record would be good, such a
> calculated record member.

Ada does not support multi-dispatch.  If you have two controlling
operands, they both have to have the same tag.

- Bob



  reply	other threads:[~2002-11-15 23:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-13 20:44 A bunch of questions that come after "Hello world" Wojtek Narczynski
2002-11-13 20:57 ` Robert A Duff
2002-11-14 10:18   ` Wojtek Narczynski
2002-11-14 11:21     ` David C. Hoos, Sr.
2002-11-14 19:51     ` tmoran
2002-11-14 21:51     ` Robert A Duff
2002-11-15 17:50       ` Wojtek Narczynski
2002-11-15 23:07         ` Robert A Duff [this message]
2002-11-18 10:24           ` Wojtek Narczynski
2002-11-18 11:54             ` Dmitry A. Kazakov
2002-11-18 16:24               ` Wojtek Narczynski
2002-11-18 21:19                 ` Robert A Duff
2002-11-19  8:48                 ` Dmitry A. Kazakov
2002-11-13 22:06 ` Martin Dowie
2002-11-14 17:48   ` Pascal Obry
2002-11-14 18:53     ` David C. Hoos
2002-11-14 22:36     ` Martin Dowie
2002-11-15  1:25       ` Jeffrey Carter
2002-11-13 22:31 ` Stephen Leake
  -- strict thread matches above, loose matches on Subject: below --
2002-11-18 10:32 Grein, Christoph
replies disabled

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