Syntax & Sematics [was: Re: [Enough already] Re: Proposal3:

Peter Crowther Peter.Crowther at IT-IQ.com
Tue Jun 6 12:44:44 UTC 2000


> From: Andrew C. Greenberg [mailto:werdna at gate.net]
> This now means that a programmer sitting at a terminal to work some 
> code must not only review the code itself, but must also study the 
> corpus of syntax definitions and pretty printer settings, hoping that 
> nothing has been set in, well, a "surprising" fashion.

Interesting --- I've read the postings in a completely different light,
namely that each developer carries around a 'preferred' set of
pretty-printer settings (or, more accurately, ways to reverse a parse tree
into human-readable form).  The canonical form is the parse tree, and one
could reasonably define a canonical 'stream' form of that which is close to
the current format.  So different developers reviewing the same parse tree
might see different views of it.

I agree with Andrew if the settings are 'sticky' and you read someone else's
stored source --- it's bad enough reading SQL Server source when you're not
sure whether the definer had ANSI nulls turned on or not.  I disagree if
there is a way in which the source can be generated specifically for that
reader.  Smalltalk, being byte-coded, is particularly amenable to this.

This also opens up an interesting area of development: a 'pretty-printer'
that is optimised for seeing a particular kind of error, such as misplaced
else-parts in if-then-else.  You could open it on an existing parse tree and
view the code in a whole new light.

		- Peter





More information about the Squeak-dev mailing list