can anyone justify the following comment behaviour?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

can anyone justify the following comment behaviour?

Stéphane Ducasse

Date: 2009-08-05 03:55:59 GMT (4 hours and 2 minutes ago)
Hi All,


   in ParseNode>>printCommentOn: there is the most perplexing  
destructive modification of a comment on printing:

printCommentOn: aStream indent: indent
         | thisComment |
         self comment == nil ifTrue: [^ self].
         1 to: self comment size
          do: [:index |
                 index > 1 ifTrue: [aStream crtab: indent].
                 aStream nextPut: $".
                 thisComment := self comment at: index.
                 self printSingleComment: thisComment
                         on: aStream
                         indent: indent.
                 aStream nextPut: $"].
  !!     self comment: nil

   The result is that a parse tree can only be printed once before it  
prints without comments.  Can anyone justify this?  I would like to  
remove it; it makes no sense to me.

best
Eliot

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: can anyone justify the following comment behaviour?

gcotelli
+1 to changing this...

On Wed, Aug 5, 2009 at 4:59 AM, Stéphane Ducasse <[hidden email]> wrote:

Date: 2009-08-05 03:55:59 GMT (4 hours and 2 minutes ago)
Hi All,


  in ParseNode>>printCommentOn: there is the most perplexing
destructive modification of a comment on printing:

printCommentOn: aStream indent: indent
        | thisComment |
        self comment == nil ifTrue: [^ self].
        1 to: self comment size
         do: [:index |
                       index > 1 ifTrue: [aStream crtab: indent].
                       aStream nextPut: $".
                       thisComment := self comment at: index.
                       self printSingleComment: thisComment
                                       on: aStream
                                       indent: indent.
                       aStream nextPut: $"].
 !!     self comment: nil

  The result is that a parse tree can only be printed once before it
prints without comments.  Can anyone justify this?  I would like to
remove it; it makes no sense to me.

best
Eliot

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project