comp.lang.ada
 help / color / mirror / Atom feed
* Re: Classes vs Tagged Types - Terminology
@ 1993-04-07 13:49 pipex!uknet!warwick!zaphod.crihan.fr!univ-lyon1.fr!scsing.switch.ch!sicsu
  0 siblings, 0 replies; 15+ messages in thread
From: pipex!uknet!warwick!zaphod.crihan.fr!univ-lyon1.fr!scsing.switch.ch!sicsu @ 1993-04-07 13:49 UTC (permalink / raw)


In article <1993Apr6.164642.9487@cenatls.cena.dgac.fr>, bruniau@cenatls.cena.dg
ac.fr (Christophe Bruniau) writes:
: 
: In article <1993Apr5.155419.8598@evb.com>, jgg@evb.com (John Goodsen) writes:
: |> In <1993Mar25.155650.16244@inmet.camb.inmet.com> 
: |> stt@spock.camb.inmet.com (Tucker Taft) writes:
: |> 
: |> >
: |> >In Ada 9X, it is only class-wide types (named "T'Class") that provide
: |> >subclass matching.
: |> >                      ^^^^^^^^^^^^^^^^^
: |>                        Didn't you mean "tagged types" :-)
: |> 
: |> Can we take this as an indicator that you are about ready to
: |> abondon the "tagged type" terminology and adopt the more
: |> appropriate "class type" terminology?  It seems that even
: |> members of the 9X project are shying away from using "tagged
: |> type" these days, so why don't just finish the scenario and
: |> adopt the "class type" syntax and terminology ...
: |> 
: |> fingers crossed...
: |> 
: 
: Does anyone know the original reason why "tagged type" was introduced,
:  instead of something like "class type" ?
: 
: Christophe BRUNIAU     bruniau@cenatls.cena.dgac.fr

Yes. I posted the reasons I had found about two? weeks ago. It basically
comes down to an implementation issue.

It is possible to come up with a language that does not use tagged
and is not ambiguous. The problem with this approach is that it would
be far too difficult to implement.

Since tagged is there for implementation reasons (representation clauses
and declaring tagged types below the library level are the stumbling 
blocks) I don't think you could come up with a better term than tagged.

However it is for this very reason that you will get nowhere it you try
and push tagged type as being a feature. The OO features being added are
class-wide types (T'Class where T is a tagged type) and type extension
(between tagged types) as well as hierachical library units.

Robb

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Classes vs Tagged Types - Terminology
@ 1993-04-06 16:46 mcsun!julienas!newsserver!geant!bruniau
  0 siblings, 0 replies; 15+ messages in thread
From: mcsun!julienas!newsserver!geant!bruniau @ 1993-04-06 16:46 UTC (permalink / raw)


In article <1993Apr5.155419.8598@evb.com>, jgg@evb.com (John Goodsen) writes:
|> In <1993Mar25.155650.16244@inmet.camb.inmet.com> 
|> stt@spock.camb.inmet.com (Tucker Taft) writes:
|> 
|> >
|> >In Ada 9X, it is only class-wide types (named "T'Class") that provide
|> >subclass matching.
|> >                      ^^^^^^^^^^^^^^^^^
|>                        Didn't you mean "tagged types" :-)
|> 
|> Can we take this as an indicator that you are about ready to
|> abondon the "tagged type" terminology and adopt the more
|> appropriate "class type" terminology?  It seems that even
|> members of the 9X project are shying away from using "tagged
|> type" these days, so why don't just finish the scenario and
|> adopt the "class type" syntax and terminology ...
|> 
|> fingers crossed...
|> 

Does anyone know the original reason why "tagged type" was introduced,
 instead of something like "class type" ?

I think that a terminology like "class type" would make explanations like
 the one below more straightforward.
This could make Ada-9X more "sexy", for those who don't see immediately
its advantages :-)

>Given a tagged type T and two derived types T1 and T2, you get the
>following:  T1'class and T2'class are subclasses of T'class.
>Any object belonging to the specific type T1 is thus an instance of
>T1'class and of T'class.  Same for T2, mutatis mutandis.  Any object
>belonging to the specific type T is an instance of T'class (but not of
>T1'class, of course). Thus:
>	X : T;  -- instance of T'class
>	Y : T1; -- instance of T1'class and T'class
>	Z : T2; -- instance of T2'class and T'class


Christophe BRUNIAU     bruniau@cenatls.cena.dgac.fr

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Classes vs Tagged Types - Terminology
@ 1993-04-06 16:36 Harry Koehnemann
  0 siblings, 0 replies; 15+ messages in thread
From: Harry Koehnemann @ 1993-04-06 16:36 UTC (permalink / raw)


In article <1993Apr5.155419.8598@evb.com> jgg@evb.com (John Goodsen) writes:
>In <1993Mar25.155650.16244@inmet.camb.inmet.com> 
>stt@spock.camb.inmet.com (Tucker Taft) writes:
>
>>In Ada 9X, it is only class-wide types (named "T'Class") that provide
>>subclass matching.
>>                      ^^^^^^^^^^^^^^^^^
>                       Didn't you mean "tagged types" :-)
>
>Can we take this as an indicator that you are about ready to
>abondon the "tagged type" terminology and adopt the more
>appropriate "class type" terminology?  It seems that even
>members of the 9X project are shying away from using "tagged
>type" these days, so why don't just finish the scenario and
>adopt the "class type" syntax and terminology ...

The term "class-wide" appears to apply to the usage of a type
classification (when declaring a parameter type for a subprogram
specification), while your favorite term "tagged type" is used
during the definition of the classification . i.e. "tagged" isn't
going away.

IMO, it would be a large mistake to refer to Ada's tagged types
as classes.  I understand your desire to use terms common in the
OO world, but great confusion lies ahead for those OO people that
have programmed using a class construct.  Classes and type extensions
are by no means the same construct and it is appropriate to make
their names distinct - "tagged"/"extended"/???, but not "class".
--
Harry Koehnemann			Arizona State University
koehnema@enuxha.eas.asu.edu		Computer Science Department

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Classes vs Tagged Types - Terminology
@ 1993-04-05 15:54 John Goodsen
  1993-04-05 23:04 ` Mark A Biggar
  0 siblings, 1 reply; 15+ messages in thread
From: John Goodsen @ 1993-04-05 15:54 UTC (permalink / raw)


In <1993Mar25.155650.16244@inmet.camb.inmet.com> 
stt@spock.camb.inmet.com (Tucker Taft) writes:

>
>In Ada 9X, it is only class-wide types (named "T'Class") that provide
>subclass matching.
>                      ^^^^^^^^^^^^^^^^^
                       Didn't you mean "tagged types" :-)

Can we take this as an indicator that you are about ready to
abondon the "tagged type" terminology and adopt the more
appropriate "class type" terminology?  It seems that even
members of the 9X project are shying away from using "tagged
type" these days, so why don't just finish the scenario and
adopt the "class type" syntax and terminology ...

fingers crossed...


-- 
John Goodsen                EVB Software Engineering, Inc.
jgg@evb.com                    - Ada & Object Oriented Training/Products
(301) 695-6960                 - Ada GUI & Graphics Tools and Training
                               - Software Reuse, Process & Environments



^ permalink raw reply	[flat|nested] 15+ messages in thread
* Classes vs Tagged Types - Terminology
@ 1993-03-22 11:46 Charles Lindsey
  1993-03-24  7:42 ` Richard A. O'Keefe
  1993-03-24  8:58 ` Robb Nebbe
  0 siblings, 2 replies; 15+ messages in thread
From: Charles Lindsey @ 1993-03-22 11:46 UTC (permalink / raw)



There has been much heated debate on comp.lang.ada concerning the
"tagged types" proposed for Ada 9x, and whether they shouldn't have
been "classes" for greater similarity with C++. I think the case has
been well made out that the tagged types in Ada 9x were the right
approach technically, given the need to maintain the look and feel of
Ada 83.

However, there is a need to decide on the correct terminology (few seem
to like the term "tagged") and, since a given term should hopefully
describe approximately the same concept in all languages where it
applies, I have widened the discussion to comp.lang.misc so that the
non-Ada world can have its say.

Here is what I have been teaching my students, by way of a taxonomy of
modularised programming. Note in particular the meaning I give to
various terms, so as to arrive at a (sort of) hierarchy of systems. I
offer this as an Aunt Sally to be shot at - I think it important that
some consensus should arise, and although Usenet discussions do not
usually lead to consensus we might at least find out what the options
are.


MODULE
A syntactic device for encapsulating groups of related declarations,
usually procedures, and usually with some means to limit the exported
identifiers so as to abstract away from implementation details.
MODULES come in two flavours:
	PACKAGES
	CLASSES

PACKAGE
A MODULE of which only one instance exists (a static module, if you like).
Things declared in the PACKAGE may be
	Operations (procedures or functions)
	Constants
	Variables
	Types
	possibly Other Packages
If the variables are not exported (but can only be initialized or
manipulated by exported operations), then we have an "ABSTRACT DATA
OBJECT". For example, I may write a PACKAGE "Stack" with hidden
implementation. This gives me just one stack.
Examples: Packages in Ada
          Modules in Modula-2
However, if I choose to declare and export one or more Types, but with
hidden internals so that only the exported operations can manipulate
them, then I have an "ABSTRACT DATA TYPE". For example, in a PACKAGE
"Stacks" I may export a Type "Stack", enabling clients to create as
many independent stacks as they wish. And I can encapsulate several
related types together and have operations that operate on, or know
about, all of them.

CLASS
A MODULE of which many instances may exist, as created by an explicit
"INVOCATION" (a dynamic module, if you like).
Things declared in the CLASS may be
	Operations (procedures or functions)
	Constants
	Variables
	Possibly other Classes
A CLASS is an elaborate kind of Type; INVOCATION typically occurs in a
variable declaration, or by an explicit creation operation (often
called 'new').
If the variables are not exported (but can only be initialized or
manipulated by exported operations), then we have an "ABSTRACT DATA
TYPE". For example, I may write a CLASS "Stack" with hidden
implementation, enabling clients to create as many independent stacks
as they wish.
Note that I cannot create a single ABSTRACT DATE OBJECT using CLASSes
(i.e. I cannot prevent a client from creating multiple instances). And
I cannot encapsulate several CLASSes together or declare operations
that operate on, or know about, several of them (except by declaring
"friends" as in C++ - not a very elegant solution IMHO).
CLASSes come in two flavours:
	Without INHERITANCE
	With INHERITANCE

CLASS Without INHERITANCE
Examples: Clusters in CLU
          Modules in Euclid

CLASS With INHERITANCE
Examples: Classes in Simula 67
          Classes in C++
          Classes in Smalltalk
          Classes in Eiffel
It is generally agreed that you need INHERITANCE to do any serious
"Object Oriented Programming". It is also common to refer to the
Operations as "Messages" in some systems.
CLASSes With INHERITANCE come in two flavours:
	SINGLE INHERITANCE
	MULTIPLE INHERITANCE
Eiffel is a good example of a language with MULTIPLE INHERITANCE.

To provide a counterpart to inheritance in PACKAGE-based systems, Types
also come in two flavours:
	TYPES Without INHERITANCE
	TYPES With INHERITANCE

TYPE Without INHERITANCE
These are the Types you have known and loved in just about every
programming language invented in the last 25 years.

TYPE With INHERITANCE
Example: Tagged Types in Ada 9x
These are to enable "Object Oriented Programming" in PACKAGE-based
languages. The concept seems good, and the (possible) advantages of
PACKAGE-based systems over CLASS-based systems are retained. The term
"Tagged Type" is used because values of such Types need to carry a Tag
around at runtime. However, some complain that implementation details
should not carry over into the syntax of High Level Languages, so maybe
some other term is needed. I offer "Classified Type" for your
consideration.

Conclusion
----------

I have offered the following concepts:

A. MODULE
    B. PACKAGE
        C. TYPE Without INHERITANCE
        D. TYPE With INHERITANCE
    E. CLASS
        F. CLASS Without INHERITANCE
        G. CLASS With INHERITANCE

I believe all these concepts are useful and necessary. Whether I have
matched the right term with each concept may be open to disagreement.
In particular, some will want to use the term CLASS for Concept G (but
what term for Concept E in that case?). There is also a need for a
better term than "Tagged Type" for Concept D.
-- 
Charles H. Lindsey -------------------------------------------------------------
           At Home, doing my own thing.           Internet: chl@clw.cs.man.ac.uk
Voice: +44 61 437 4506                            Janet:    chl@uk.ac.man.cs.clw
Snail: 5 Clerewood Ave., CHEADLE, SK8 3JU, U.K.   UUCP:     mucs!clerew!chl



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~1993-04-07 13:49 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-04-07 13:49 Classes vs Tagged Types - Terminology pipex!uknet!warwick!zaphod.crihan.fr!univ-lyon1.fr!scsing.switch.ch!sicsu
  -- strict thread matches above, loose matches on Subject: below --
1993-04-06 16:46 mcsun!julienas!newsserver!geant!bruniau
1993-04-06 16:36 Harry Koehnemann
1993-04-05 15:54 John Goodsen
1993-04-05 23:04 ` Mark A Biggar
1993-03-22 11:46 Charles Lindsey
1993-03-24  7:42 ` Richard A. O'Keefe
1993-03-25 15:56   ` Tucker Taft
1993-03-26 11:02     ` Stephen J Bevan
1993-03-30 14:34       ` Tucker Taft
1993-03-31 16:21         ` Stephen J Bevan
1993-03-31 20:46         ` Robert I. Eachus
1993-03-24  8:58 ` Robb Nebbe
1993-03-25  0:15   ` David Emery
1993-03-29  9:26     ` Robb Nebbe

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