Hi Lars: very good to know. I put it into our related work directory. -- Karl >From lth@ccs.neu.edu Fri Sep 24 21:51:26 1999 >To: dougo@ccs.neu.edu, lieber@ccs.neu.edu, johan@ccs.neu.edu >Subject: Algebraic DT / visitor-style programming in C++ >From: Lars Thomas Hansen > > >This just in; I don't know anything more about it than it says but >the comment about visitor-style programming in C++ caught my eye and >so naturally I thought of you three. > >--lars > >From: George Nelan >Subject: ANN. Free C++ Algebraic Types >Newsgroups: comp.lang.functional >Date: Thu, 23 Sep 1999 02:01:47 GMT >Organization: @Home Network >Path: news.ccs.neu.edu!news.dfci.harvard.edu!news.cis.ohio-state.edu!news.compuserve.com!news-master.compuserve.com!newsfeed.enteract.com!nntp.abs.net!newshub2.home.com!news.home.com!news.rdc1.az.home.com.POSTED!not-for-mail >Message-ID: <37E988D0.A6151BB1@home.com> >X-Mailer: Mozilla 4.5 [en]C-AtHome0405 (Win95; U) >X-Accept-Language: en >MIME-Version: 1.0 >Content-Type: text/plain; charset=us-ascii >Content-Transfer-Encoding: 7bit >Lines: 49 >NNTP-Posting-Host: 24.1.224.177 >X-Complaints-To: abuse@home.net >X-Trace: news.rdc1.az.home.com 938052107 24.1.224.177 (Wed, 22 Sep 1999 19:01:47 PDT) >NNTP-Posting-Date: Wed, 22 Sep 1999 19:01:47 PDT >Xref: news.ccs.neu.edu comp.lang.functional:8629 > >Not to peg the hype-o-meter, but app 1.0 is available. > >'App' is a preprocessor for C++ that accepts as input arbitrary >C++ code that may contain embedded constructs for specifying >algebraic data types and associated pattern matching operations, >and produces as output the same code with all such constructs >translated to normal C++. What app essentially does is provide >for C++ pretty much the same capabilities that functional >languages have regarding algebraic types. In a sense app can be >viewed as bringing C++ closer to the functional programming world, >although perhaps just as well app can be viewed as directly >supporting certain kinds of visitor-style patterns in C++, insofar >as algebraic types can be viewed as supporting such patterns. > >App is free software distributed under the terms of the GPL/LGPL. >This software was developed on a W95 Intel platform using MS VC++ >5.0, and is initially targeted for similar platforms, though it >should be easy enough to retarget for most any platform supporting >a relatively modern C++ compiler. The source code is not -- or at >least should not be -- MS specific. Substantial portions of app >are written in itself. You can download the software and browse >the documentation at: > > http://www.primenet.com/~georgen/app.html > >Here's a short example; function foo() produces "Y:{42}". > >$base I(int x) { > bool print(ostream& os) { > os << x(); > return true; > } >}; > >$data W $forward; >$data X = Y(A a) | Z(W a); >$data W = V(X a); > >void foo() { > $match (V(Y(42))) { > (V(y)) => {cout << y << endl;} > } >} > >-- >George Nelan >mailto:nelan@home.com > >PS. Yes, I know that this is comp.lang.functional. >