[ENH] (?) Pretty Printing

Les Tyrrell tyrrell at canis.uiuc.edu
Thu Jan 27 17:50:58 UTC 2000


Personal tastes are too varied and too entrenched to suffer the existence
of a single standard.  However, this is not a problem- a good formatter
can dynamically reformat whatever code you are looking at on demand.  There
is no need to be stuck with a standard that has to be argued over, and ultimately
not entirely satisfying to at least some of its victims.

The fundamental property the formatter requires is to be readily reconfigured
by the user.  Although I haven't tried to do this, the Refactoring Browser's
formatter is supposedly reconfigurable.  I don't know if it has a handy user
interface to allow easy adjustments, or if it requires recoding parameters or
heuristics to do this.   The formatter I was working on has parameters that
can be changed, but it is still very early in the development cycle.  However,
it did format nearly all of the methods in Squeak 2.3 without introducing
errors into the code, and most of what it did I liked.  At that time, there
were about 6 methods in the entire system that would require very careful
examination in order to determine why there was a discrepancy in the bytecodes
that would result from the unformatted and formatted sources.  The discrepancies
were not neccessarily errors- the compilation framework has changed over time, and
you will find evidence of that as you run the regression tests on the formatter.


-les



"demiourgos at smalltalk.org" wrote:

> What about the idea of having a standard pretty printer, but using
> stylized comments to direct it to format things in a specified way
> rather than following its rules?  Perhaps the "stylized comments" might
> adopt some of the verbs from XSL or HTML?
> 
>  --jtg
> 
> >
> > I would like to have some parameters which control the behavior of a
> > pretty print formatter and allow different styles of formatting:
> > preferably with very few good default styles.
> >
> > I also would like to have a _standard_ formatting style resulting from a
> > deep discussion to use for code examples in e.g. eMails, tutorials and
> > books. Then there would coexist _one_ commonly used style and the
> > alternative styles for individual use.
> >
> >
> > P.S.: 'I would like to have ...' denotes wishes, not claims.
> > --
> > Stephan Rudlof (sr at evolgo.de)
> >    "Genius doesn't work on an assembly line basis.
> >     You can't simply say, 'Today I will be brilliant.'"
> >     -- Kirk, "The Ultimate Computer", stardate 4731.3





More information about the Squeak-dev mailing list