TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
"Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
Simon Wright <[log in to unmask]>
Fri, 20 Nov 1998 18:15:28 -0500
"Robert I. Eachus" <[log in to unmask]>
"Robert I. Eachus" <[log in to unmask]>
text/plain; charset="us-ascii"
text/plain (42 lines)
At 06:16 AM 11/17/98 GMT, Simon Wright wrote:
> From: Samuel Mize <[log in to unmask]>
> Perhaps a "class" package would also require that all the subprograms
> in the package have the controlling operand as the first parameter
> (the return value, for functions).  This would help out the people who
> find the syntax "object.message" to be more readable.

   This is starting to get silly.  Ada is a very rich language, and while I
can understand having a tool to detect some departures from local coding
standards and software engineering practices, putting on a straight-jacket
is not all that good an idea.  For example:

    type Set is...

    function "+"(L,R: Set) return Set;
    function "-"(L: Set, R: Element) return Set;
    -- and so on.

    In addition if you really prefer the class.method(parameters) notation,
Ada has it all over the place:

and of course, and most important:
where the package is often a generic instance and is used as an object of
the class defined by the generic template.  This is a very powerful
technique in Ada, and is one of many models that a good software engineer
will consider when choosing how to model a particular class of objects in a
particular design.  Generic instance as object is not a good model if you
have many objects of the class, or if the number of objects is highly
dynamic.  But it is great when you have objects with no particular
hierarchy, and many different types of state variables.

                                        Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...