comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shell5.ba.best.com>
Subject: Re: Extensible Enummerated types FW: When will next Ada revision be? (83, 95, ?)
Date: Sat, 20 Jan 2001 22:27:23 GMT
Date: 2001-01-20T22:27:23+00:00	[thread overview]
Message-ID: <Pine.BSF.4.21.0101201408160.16701-100000@shell5.ba.best.com> (raw)
In-Reply-To: <94coa2$v2v$1@nnrp1.deja.com>

On Sat, 20 Jan 2001, Robert Dewar wrote:
> In article <94ce27$rrb$1@news.cis.ohio-state.edu>,
>   carroll@cis.ohio-state.edu (Mark Carroll) wrote:
> > In article <t6jeim807fic0a@corp.supernews.com>,
> > Jeff Creem <jeff@thecreems.com> wrote:
> > (snip)
> > >Whether the extra complexity this imposes on compiler writes
> (or language
> > >learners) is worth the occasional
> > >convenience is certainly debatable.
> >
> > FWIW, I certainly make use of it in other languages.
>                                             ^^^^^^^^^
> 
> How about specifices, since not many languages support
> this capability (C and C++ do not even have enumeration
> types in the sense in which we are discussing things now
> after all :-)

Objective Caml, since version 3.0, has something close, called
"polymorphic variants". It's not quite the same, since sum types 
aren't quite the same as enums, but probably close enough for 
comparison. In Ocaml, the new variants can act as anonymous tags.

One reason the comparison is tough is that since Ocaml doesn't have 
overloading, the polymorphic variants are justifiable IMO simply because 
they allow a kind of overloading of variants. There are some neat tricks 
you can do with them, like providing a visitor which can be extended
easily, but in my own Ocaml programming I've found that its the fact that 
I can overload variants that's the big win, and this is obviously not a 
problem with Ada. 

See

    http://caml.inria.fr/ocaml/htmlman/manual003.html

for some info on polymorphic variants, or find Jacques Garrigue's Olabl
page and check out his publications on the topic.

I think for any given feature that someone wants to add to Ada they should
be able to provide a small example, preferably something natural. For
instance, in the resubmitted AI for downward funargs someone mentioned a 
paper in "Software Practice and Experience" about combinatorial searching
or somesuch. Now, while that may be interesting, and the example I gave a
while ago about composing integrators is interesting, and likewise
backtracking parsers, I think the simple example of iterators that was
presented during the 9X process (you can see something like it in Barnes'
book) is really the best. Very simple, very natural, it seems like you
should be able to do it in Ada, but you can't. Examples of the withing
problem (soon to be OBE I hope!) are also pretty simple.  

-- Brian





  reply	other threads:[~2001-01-20 22:27 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-20  7:26 Extensible Enummerated types FW: When will next Ada revision be? (83, 95, ?) Robert C. Leif, Ph.D.
2001-01-20 14:06 ` Robert Dewar
2001-01-20 16:19   ` Jeff Creem
2001-01-20 16:23     ` Mark Carroll
2001-01-20 19:18       ` Robert Dewar
2001-01-20 22:27         ` Brian Rogoff [this message]
2001-01-21 16:06           ` Robert Dewar
2001-01-21 23:08             ` Brian Rogoff
2001-01-22  2:02               ` Robert Dewar
2001-01-22 16:02                 ` Brian Rogoff
2001-01-22 16:50                   ` Robert Dewar
2001-01-22 21:12                     ` Brian Rogoff
2001-01-22 21:26                       ` Jean-Pierre Rosen
     [not found]                         ` <Pine.BSF.4.21.0101230839000.15065-100000@shell5.ba.best.com>
     [not found]                           ` <94rbdo$vf$1@wanadoo.fr>
2001-01-26 16:41                             ` LOF4 (Was Re: Extensible Enummerated types) Brian Rogoff
2001-01-20 22:34         ` Extensible Enummerated types FW: When will next Ada revision be? (83, 95, ?) Mark Carroll
2001-01-21 16:09           ` Robert Dewar
2001-01-21 19:04             ` Mark Carroll
2001-01-21 19:26               ` Robert Dewar
2001-01-21 21:12                 ` Mark Carroll
2001-01-21 17:47     ` Nick Roberts
2001-01-21 19:37       ` Robert Dewar
2001-01-22 17:26         ` Mark Lundquist
2001-01-22 20:47           ` Randy Brukardt
2001-01-22 21:41             ` Matthew Woodcraft
2001-01-30 16:17           ` Tucker Taft
2001-01-31  8:05             ` Extensible Enumerated " Robert C. Leif, Ph.D.
2001-02-10 20:34               ` Vincent Marciante
2001-01-31  8:05             ` Supertypes RE: Extensible Enumerated types Robert C. Leif, Ph.D.
2001-01-31 15:15               ` Marin David Condic
2001-02-01 22:03             ` Extensible Enummerated types FW: When will next Ada revision be? (83, 95, ?) Nick Roberts
2001-02-02  3:48               ` Robert Dewar
2001-02-02  4:41                 ` Jeffrey Carter
2001-02-02  7:26                   ` Robert C. Leif, Ph.D.
2001-02-02 16:38                     ` Robert Dewar
2001-02-02 20:39                     ` (Private message. Sorry) Nick Roberts
2001-01-22 15:02 ` Extensible Enummerated types FW: When will next Ada revision be? (83, 95, ?) Ted Dennison
2001-01-28  8:10   ` Robert C. Leif, Ph.D.
2001-02-02 21:54     ` Nick Roberts
replies disabled

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