From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5b0235b23a9db0f2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-20 14:27:01 PST Path: supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!sjc-peer.news.verio.net!news.verio.net!sjc-read.news.verio.net.POSTED!not-for-mail Newsgroups: comp.lang.ada From: Brian Rogoff Subject: Re: Extensible Enummerated types FW: When will next Ada revision be? (83, 95, ?) In-Reply-To: <94coa2$v2v$1@nnrp1.deja.com> Message-ID: References: <94c61v$h4a$1@nnrp1.deja.com> <94ce27$rrb$1@news.cis.ohio-state.edu> <94coa2$v2v$1@nnrp1.deja.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Sat, 20 Jan 2001 22:27:23 GMT NNTP-Posting-Host: 206.184.139.136 X-Complaints-To: abuse@verio.net X-Trace: sjc-read.news.verio.net 980029643 206.184.139.136 (Sat, 20 Jan 2001 22:27:23 GMT) NNTP-Posting-Date: Sat, 20 Jan 2001 22:27:23 GMT Organization: Verio Xref: supernews.google.com comp.lang.ada:4247 Date: 2001-01-20T22:27:23+00:00 List-Id: 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 , > > Jeff Creem 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