If in Pharo-1.4 I put a halt in a printOn: method (e.g.
Interval>>#printOn: ) and then printIt Interval from: 0 to: 200 I get an endless loop of Halt Interval(Object)>>halt Interval>>printOn: Interval(Object)>>printStringLimitedTo: in Block: [:s | self printOn: s] String class(SequenceableCollection class)>>streamContents:limitedTo: Interval(Object)>>printStringLimitedTo: MethodContext>>printDetails: in Block: [receiver printStringLimitedTo: 90] BlockClosure>>on:do: BlockClosure>>ifError: MethodContext>>printDetails: MethodContext(ContextPart)>>errorReportOn: Halt Interval(Object)>>halt Interval>>printOn: Interval(Object)>>printStringLimitedTo: in Block: [:s | self printOn: s] String class(SequenceableCollection class)>>streamContents:limitedTo: Interval(Object)>>printStringLimitedTo: MethodContext>>printDetails: in Block: [receiver printStringLimitedTo: 90] BlockClosure>>on:do: BlockClosure>>ifError: MethodContext>>printDetails: MethodContext(ContextPart)>>errorReportOn: Halt Interval(Object)>>halt Interval>>printOn: Interval(Object)>>printStringLimitedTo: in Block: [:s | self printOn: s] String class(SequenceableCollection class)>>streamContents:limitedTo: Interval(Object)>>printStringLimitedTo: MethodContext>>printDetails: in Block: [receiver printStringLimitedTo: 90] BlockClosure>>on:do: BlockClosure>>ifError: MethodContext>>printDetails: MethodContext(ContextPart)>>errorReportOn: Is there a common way to debug printing statements? Thanks Paul |
Hi,
Yes, the method is called again by the printing code. For this, there is #haltOnce. put Halt once. and enable it via the system menu (or Halt enableHaltOnce). Marcus On Mar 4, 2013, at 7:41 PM, Paul DeBruicker <[hidden email]> wrote: > If in Pharo-1.4 I put a halt in a printOn: method (e.g. > Interval>>#printOn: ) and then printIt > > Interval from: 0 to: 200 > > I get an endless loop of > > > Halt > Interval(Object)>>halt > Interval>>printOn: > Interval(Object)>>printStringLimitedTo: in Block: [:s | self printOn: s] > String class(SequenceableCollection class)>>streamContents:limitedTo: > Interval(Object)>>printStringLimitedTo: > MethodContext>>printDetails: in Block: [receiver printStringLimitedTo: 90] > BlockClosure>>on:do: > BlockClosure>>ifError: > MethodContext>>printDetails: > MethodContext(ContextPart)>>errorReportOn: > Halt > Interval(Object)>>halt > Interval>>printOn: > Interval(Object)>>printStringLimitedTo: in Block: [:s | self printOn: s] > String class(SequenceableCollection class)>>streamContents:limitedTo: > Interval(Object)>>printStringLimitedTo: > MethodContext>>printDetails: in Block: [receiver printStringLimitedTo: 90] > BlockClosure>>on:do: > BlockClosure>>ifError: > MethodContext>>printDetails: > MethodContext(ContextPart)>>errorReportOn: > Halt > Interval(Object)>>halt > Interval>>printOn: > Interval(Object)>>printStringLimitedTo: in Block: [:s | self printOn: s] > String class(SequenceableCollection class)>>streamContents:limitedTo: > Interval(Object)>>printStringLimitedTo: > MethodContext>>printDetails: in Block: [receiver printStringLimitedTo: 90] > BlockClosure>>on:do: > BlockClosure>>ifError: > MethodContext>>printDetails: > MethodContext(ContextPart)>>errorReportOn: > > > > > Is there a common way to debug printing statements? > > Thanks > > Paul > |
Free forum by Nabble | Edit this page |