comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@bix.com (Tom Moran)
Subject: Re: How to write TYPECASE in Ada 95?
Date: 1999/02/19
Date: 1999-02-19T00:00:00+00:00	[thread overview]
Message-ID: <36cdb012.580716@news.pacbell.net> (raw)
In-Reply-To: 1103_918264881@DZOG-CHEN

>>> I thought a good part of the point of tagged types
>>> (and support for polymorphism in other OOP's) was
>>> exactly to avoid this kind of code. (series of if-elsif)

>>Dispatching is certainly better than a case statement - if you use it.
>>Consider an existing package of the form: (example of dispatching being inappropriate)

>tmoran@bix.com (Tom Moran) writes:
>> Dispatching is certainly better than a case statement -
>> if you use it.
>I strongly disagree with this statement. This particular
>bit of conventional wisdom is badly in error, and can lead
>to unnecessarily obscure hard to maintain programs.
>Case statements and dispatching represent two ways of
  I see you strongly agree that dispatching is not always the
solution, and a case statement, for instance, is more appropriate.
But in the situation at hand, the only thing apparently available is
the original poster's original if-elsif list, with the usual hazards
of left out or overlapping cases.  Was something like Modula 3's
"Typecase" considered for Ada 95?  Are there problems with it?  




  parent reply	other threads:[~1999-02-19  0:00 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-05  0:00 How to write TYPECASE in Ada 95? Norman Ramsey
1999-02-05  0:00 ` Brian Rogoff
1999-02-05  0:00   ` David C. Hoos, Sr.
1999-02-05  0:00     ` Brian Rogoff
1999-02-06  0:00   ` Ed Falis
1999-02-06  0:00     ` Nick Roberts
1999-02-06  0:00       ` Nick Roberts
1999-02-17  0:00     ` Tom Moran
1999-02-18  0:00       ` Matthew Heaney
1999-02-18  0:00         ` robert_dewar
1999-02-19  0:00           ` Tom Moran
1999-02-19  0:00           ` Nick Roberts
1999-02-18  0:00         ` Tom Moran
1999-02-18  0:00         ` Tom Moran
1999-02-18  0:00           ` Matthew Heaney
1999-02-19  0:00     ` Tom Moran [this message]
1999-02-19  0:00       ` Tom Moran
1999-02-23  0:00       ` Samuel Mize
1999-02-23  0:00         ` Question (was Re: How to write TYPECASE in Ada 95?) Mike Silva
1999-02-24  0:00           ` (long) programming by extension (was: " Samuel Mize
1999-02-24  0:00             ` (long) programming by extension Samuel Mize
1999-02-25  0:00               ` (shorter and new) " Samuel Mize
1999-02-25  0:00                 ` Mike Silva
1999-02-26  0:00                   ` Samuel Mize
1999-02-24  0:00           ` Question (was Re: How to write TYPECASE in Ada 95?) Nick Roberts
1999-02-24  0:00           ` Samuel T. Harris
1999-02-24  0:00             ` Matthew Heaney
1999-02-24  0:00               ` Tucker Taft
1999-02-06  0:00 ` How to write TYPECASE in Ada 95? David C. Hoos, Sr.
1999-02-06  0:00   ` Matthew Heaney
1999-02-06  0:00     ` Matthew Heaney
1999-02-06  0:00     ` Matthew Heaney
1999-02-09  0:00     ` David C. Hoos, Sr.
1999-02-06  0:00 ` Matthew Heaney
replies disabled

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