Hi Doug: >From dougo@ccs.neu.edu Thu Jun 12 18:29:55 1997 >From: Doug Orleans >To: Karl Lieberherr >Cc: dem@ccs.neu.edu >Subject: Re: generic visitors > >Karl Lieberherr writes: > > >Also, I'd prefer not to call them g_*; > > >we should use Java functions where appropriate, e.g. toString() for the > > > > I agree! > > > > >PrintVisitor traversal > >Actually, I think I changed my mind about this one already-- not >always do you want toString() to be the parsable-representation of the >object. For example, String.toString() is just the contents of the >string, without quotation marks. Maybe unparse() is a better name for >this, since that's essentially its only contract-- to create a string >that, when parsed, re-creates the object structure. Then if the user >wants toString for some classes to be the same as unparse(), he can >define that manually (and this is easier in demjava because you can >attach a single method to a list of classes at once). Also, sometimes >you want to print things to a stream as you traverse, rather than collect it >all to a string and print it out at the end; one could imagine a >before() method that, e.g., prompted the user for some input, so you'd >want the output to be flushed before the prompt. > >--Doug > Thank you for this improvement. You make a convincing argument for the name unparse. -- Karl