[ENH] (?) Pretty Printing

Dean_Swan at Mitel.COM Dean_Swan at Mitel.COM
Thu Jan 20 16:29:46 UTC 2000



From:  Dean Swan at MITEL on 01/20/2000 11:29 AM

Les,

     Thanks for the offer.  The very simple change I posted is good enough to
keep me happy for now, but I would be interested in looking at what else you've
done.  I've been chatting with John Maloney a little about this, and a nice
pretty printer plus a modified 'Smalltalk abandonSources' method that would
preserve comments, as well as temp names would be an easy way to lighten the
complete Squeak system by 5 to 10 megabytes, which would be outstanding for use
on things like PDAs.
     I'm currently running a full 2.5 system on my Casio E-105, and 2.7 won't
fit into the internal memory without some pruning, so I definitely have an
interest in this.  I'm working on another project with John right now, so I
won't be able to get to this for a while, but I think it's very worth pursuing.
I also wouldn't be the least bit upset if somebody else implemented it and
posted it to the list. :-)

                                   -Dean Swan
                                   dean_swan at mitel.com





"Les Tyrrell" <tyrrell at canis.uiuc.edu> on 01/20/2000 12:26:46 AM

Please respond to squeak at cs.uiuc.edu

To:   squeak at cs.uiuc.edu
cc:    (bcc: Dean Swan/Ogd/Mitel)

Subject:  Re: [ENH] (?) Pretty Printing





Once upon a time, I started to revamp the pretty printer in Squeak... in the
past I have done this in VisualWorks, so I've seen many of the issues that
come up, such as getting single-statement blocks to be printed differently
from multi-statement blocks. ( actually, an issue of "complex" internals vs.
"simple" internals, where a block was considered "complex" if it had
more than one statement, or if it's sole statement was itself "complex",
typically meaning that it had more than 1 argument ).  I don't recall if I
had gotten this logic into the Squeak pretty printer or not.

The code I've written so far is available, but I'm on the road and responding
offline.
I'll be back online next week, so if you have an interest in moving this forward
send me an e-mail and I'll make sure that the code is reachable.

les


----- Original Message -----
From: <Dean_Swan at Mitel.COM>
To: <squeak at cs.uiuc.edu>
Cc: <John.Maloney at disney.com>
Sent: Wednesday, January 19, 2000 10:22 AM
Subject: [ENH] (?) Pretty Printing


>
> This change formats code so that opening and closing brackets for a block are
> aligned in the same column, and statements in the block are indented one tab
> more than the block brackets.  For me this makes code far easier to read and
> understand the control flow "at-a-glance".  I know this can be quite a
religious
> issue for some people, but still I'd like to know what people think about this
> change.
>
> This isn't exactly what I wanted, as I would still prefer to have single
> statement blocks all on one line, but I couldn't figure out how to do this
> easily and still get this formatting for multi-statement blocks, so I chose
this
> as the lesser of the two evils.
>
>                                    Enjoy! (or not :-) )
>
>                                    -Dean Swan
>                                    dean_swan at mitel.com
>
>
>
>
> 'From Squeak 2.5 of August 6, 1999 on 19 January 2000 at 11:19:55 am'!
>
> !BlockNode methodsFor: 'printing' stamp: 'DRS 1/19/2000 11:19'!
> printOn: aStream indent: level
>
>      "Modified to force alignment of opening and closing brackets in the same
> column,
>       and indent statements within a block by one additional tab.  drs
> 1/18/2000"
>
>
>      aStream crtab: level.
>      "statements size <= 1 ifFalse: [aStream crtab: level]."
>      aStream nextPut: $[.
>      aStream crtab: (level + 1).
>      self printArgumentsOn: aStream indent: (level + 1).
>      self printStatementsOn: aStream indent: (level + 1).
>      aStream crtab: level.
>      aStream nextPut: $]! !
>
>
>











More information about the Squeak-dev mailing list