Dear Johan: Thank you for your note. We look forward to the visit of your coauthor. Regarding polytypic programming in Java: In Demeter/Java we use a partial evaluation approach. http://www.ccs.neu.edu/home/lieber/Demeter-and-Java.html As soon as the type graph is known (we call it class graph), we partially evaluate all kinds of generic visitors and traversals: PrintVisitor EqualVisitor DisplayVisitor CopyVisitor TraceVisitor and we could have more like ObjectMatchingVisitor (inspired by your polytypic unifier) They come out as custom made just for the current class graph. We also generate a universal traversal custom made for the class graph. This traversal goes everywhere. This universal traversal (Palsberg and Jay call this the WalkAbout class) does most of the time too much traversing. To generate custom made shorter traversals, we use strategies. So from my point of view, key ingredients for polytypic programming in Java are: Partial evaluation of generic visitors Strategies Visitors and adjusters and composition mechanisms for them, similar to the adaptive methods of Demeter/Java. We will discuss those issues with Patrick. Best regards, -- Karl From johanj@cs.ruu.nl Thu Apr 9 05:08:26 1998 To: Karl Lieberherr , patrikj@cs.chalmers.se From: Johan Jeuring Subject: Re: Polytypic and Adaptive Cc: dem@ccs.neu.edu, johanj@cs.chalmers.se Dear Karl, >4. We are currently working on visitors and adjusters which are > parameterized by strategies. They are polytypic components which > can be composed and maybe the polytypic framework you have > can be used to formalize elegantly visitors and adjusters. > >I was wondering how the ideas in PolyP can be best applied to oo >languages, like Java. I suppose you have seen the paper `The Essence of the Visitor Pattern' from Palsberg and Jay? In this paper the authors define a method (using reflection) that visits arbitrary classes. Since visitors are very similar to cata's and para's this would give a way to define polytypic functions such as size etc in Java. However, I don't think it will be very easy to define such methods, and I would like to spend some time on extracting the essential components of polytypic programs in Java, that is, to define a kind of polytypic construct in Java. A disadvantage of using reflection is that programs using reflection are rather slow, so one would probably also have to look at partial evaluation (as in PolyP) or something like that to obtain acceptable performance. Kind regards, Johan Jeuring