Pretty Print bug?

Russell Penney russell.penney at tincanct.com
Fri Jun 18 03:15:09 UTC 2004


After trying to unsuccessfully get the bug happening, I gave up only to see
it a few minutes later. All I did was start typing a new line in an existing
method (I was refactoring code), I deleted the couple of characters I had
written and accepted the method. Now if I select anything else and come back
to this method it read exactly how I typed it! Wierdness and bloody annoying
as it happens while I am debugging. I have to click on something else and
back or it could save and I lose comments and variable names (had it happen
:-( )

 

Here is how it displays:

 

applyWindowToPCM: t1 

            | t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t13 |

            t2 := mode blocksize.

            t3 := previousWindowFlag

                                                ifTrue: [t4 := setup windows
at: 2.

                                                            ident blocksize
at: 2]

                                                ifFalse: [t4 := setup
windows at: 1.

                                                            ident blocksize
at: 1].

            t5 := nextWindowFlag

                                                ifTrue: [t11 := setup
windows at: 2.

                                                            ident blocksize
at: 2]

                                                ifFalse: [t11 := setup
windows at: 1.

                                                            ident blocksize
at: 1].

            t6 := t2 // 4 - (t3 // 4).

            t7 := t6 + (t3 // 2).

            t8 := t2 // 2 + (t2 // 4) - (t5 // 4).

            t9 := t8 + (t5 // 2).

            t1

                        from: 1

                        to: t6

                        put: 0.0.

            t10 := 0.

            t13 := t7 - 1.

            t6

                        to: t13

                        do: [:t12 | 

                                    t1 at: t12 + 1 put: (t1 at: t12 + 1)

                                                            * (t4 window at:
t10 + 1).

                                    t10 := t10 + 1].

            t10 := t5 // 2 - 1.

            t13 := t9 - 1.

            t8

                        to: t13

                        do: [:t12 | 

                                    t1 at: t12 + 1 put: (t1 at: t12 + 1)

                                                            * (t11 window
at: t10 + 1).

                                    t10 := t10 - 1].

            t1

                        from: t9 + 1

                        to: t2

                        put: 0.0

 

 

And how it should display:

 

applyWindowToPCM: p

 

| n ln lastW rn leftbegin leftend rightbegin rightend j nextW |

n := mode blocksize.

ln := previousWindowFlag

            ifTrue: [ 

                        lastW := setup windows at: 2. 

                        ident blocksize at: 2 ]

            ifFalse: [ 

                        lastW := setup windows at: 1. 

                        ident blocksize at: 1 ].

 

rn := nextWindowFlag

            ifTrue: [ 

                        nextW := setup windows at: 2. 

                        ident blocksize at: 2 ]

            ifFalse: [ 

                        nextW := setup windows at: 1.

                        ident blocksize at: 1 ].

 

leftbegin := ( n // 4 ) - ( ln // 4 ).

    

leftend := leftbegin + ( ln // 2 ).

rightbegin := ( n // 2 ) + ( n // 4 ) - ( rn // 4 ).

    

rightend := rightbegin + ( rn // 2 ).

 

p from: 1 to: leftbegin put: 0.0.

 

j := 0.

leftbegin to: leftend - 1 do: [ :i |

            p at: i + 1 put: ( p at: i + 1 ) * ( lastW window at: j + 1 ).

            j := j + 1 ].

 

j := ( rn // 2 ) - 1.

rightbegin to: rightend - 1 do: [ :i |

            p at: i + 1 put: ( p at: i + 1 ) * ( nextW window at: j + 1 ).

            j := j - 1 ].

 

p from: rightend + 1 to: n put: 0.0 .

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040618/70c2ce13/attachment.htm


More information about the Squeak-dev mailing list