Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!ames!apple!usc!orion.cf.uci.edu!uci-ics!schmidt@zola.ics.uci.edu From: schmidt@zola.ics.uci.edu (Doug Schmidt) Newsgroups: comp.lang.c++ Subject: Re: Exception handling and transaction management? Message-ID: <19176@paris.ics.uci.edu> Date: 6 Jul 89 04:11:27 GMT References: <546@voodoo.UUCP> <6590181@hplsla.HP.COM> Sender: news@paris.ics.uci.edu Reply-To: schmidt@zola.ics.uci.edu (Doug Schmidt) Organization: University of California, Irvine - Dept of ICS Lines: 55 In article <6590181@hplsla.HP.COM>, jima@hplsla (Jim Adcock) writes: >>re: iterations >> >> basically, some linguistic concept that allows you to iterate >> over the contents of a class, e..g, a bag, a list, a whatever. >> >> while it's true that C++ doesn't have iterators, it's not clear >> that it needs them. Libg++ has the Pix (pseudo-index) class >> that resolves this problem (albeit, perhpas not as `nicely' >> as the iterators in clu). >> >> this is an important concept, but it's not clear that it needs >> linguistic methods to be possible. > >The emerging standard for iterators seems to be overloading operator()() >to provide interation. There is a group of researchers at the University of Wisconsin that are implementing an interesting C++ superset called E (I guess that's really (C += 2) ;-)). One useful extension they've added is Clu-style iterators. Here's a contrived example that demonstrates the usage: ---------------------------------------- iterator char *getstr (char **argv) { while (*argv) yield *argv++; } main (int argc, char **argv) { iterate (char *s = getstr (argv)) printf ("item = %s\n", s); } ---------------------------------------- The C++ syntax is quite clean (although the underlying generated C implementation is pretty hairy). In addition to iterators, the main language extensions that E provides are generic classes (sort of like the templates described in Stroustrup's paper), persistent data base types, and honest-to-goodness nested classes (the way they are *supposed* to work, i.e., like nested records in Ada or Pascal!!). There is a tech report that describes the E language, also. Doug Schmidt -- Master Swordsman speak of humility; | schmidt@ics.uci.edu (ARPA) Philosophers speak of truth; | office: (714) 856-4034 Saints and wisemen speak of the Tao of no doubt; The moon, sun, and sea speaks for itself. -- Hiroshi Hamada