diff --git a/kernel/Collection.st b/kernel/Collection.st index 60f8923..42ddb4e 100644 --- a/kernel/Collection.st +++ b/kernel/Collection.st @@ -524,14 +524,13 @@ of objects.'> ] - inspect [ - "Print all the instance variables and objects in the receiver on the - Transcript" + inspectOn: aStream [ + "Print all the instance variables and objects in the receiver on aStream" | instVars output object | self beConsistent. - Transcript + aStream nextPutAll: 'An instance of '; print: self class; nl. @@ -547,13 +546,13 @@ of objects.'> return: '%1 %2' % {object class article. object class name asString}]. - Transcript + aStream nextPutAll: ' '; nextPutAll: (instVars at: i); nextPutAll: ': '; nextPutAll: output; nl]. - Transcript + aStream nextPutAll: ' contents: ['; nl. self do: @@ -566,11 +565,11 @@ of objects.'> return: '%1 %2' % {obj class article. obj class name asString}]. - Transcript + aStream nextPutAll: ' '; nextPutAll: output; nl]. - Transcript + aStream nextPutAll: ' ]'; nl ] diff --git a/kernel/CompildCode.st b/kernel/CompildCode.st index 26181d2..b3cc067 100644 --- a/kernel/CompildCode.st +++ b/kernel/CompildCode.st @@ -362,13 +362,13 @@ superclass for blocks and methods'> ^self shallowCopy postCopy ] - inspect [ + inspectOn: aStream [ "Print the contents of the receiver in a verbose way." | instVars lit object output | instVars := self class allInstVarNames. - Transcript + aStream nextPutAll: 'An instance of '; print: self class; nl. @@ -383,35 +383,35 @@ superclass for blocks and methods'> return: '%1 %2' % {object class article. object class name asString}]. - Transcript + aStream nextPutAll: ' '; nextPutAll: (instVars at: i); nextPutAll: ': '; nextPutAll: output; nl. - i = 2 ifTrue: [self printHeaderOn: Transcript]]. + i = 2 ifTrue: [self printHeaderOn: aStream]]. self numLiterals > 0 ifTrue: - [Transcript + [aStream nextPutAll: ' literals: ['; nl. 1 to: self numLiterals do: [:i | - self bytecodeIndex: i with: Transcript. - Transcript tab. + self bytecodeIndex: i with: aStream. + aStream tab. lit := self literalAt: i. lit printNl]. - Transcript + aStream nextPutAll: ' ]'; nl]. self numBytecodes > 0 ifTrue: - [Transcript + [aStream nextPutAll: ' byte codes: ['; nl. - self printByteCodesOn: Transcript. - Transcript + self printByteCodesOn: aStream. + aStream nextPutAll: ' ]'; nl] ] diff --git a/kernel/Dictionary.st b/kernel/Dictionary.st index 6c688ee..9866cec 100644 --- a/kernel/Dictionary.st +++ b/kernel/Dictionary.st @@ -430,35 +430,34 @@ certain special cases.'> ^hashValue ] - inspect [ - "Print all the instance variables and objects in the receiver on the - Transcript" + inspectOn: aStream [ + "Print all the instance variables and objects in the receiver on aStream" | class instVars i | self beConsistent. class := self class. instVars := class allInstVarNames. - Transcript nextPutAll: 'An instance of '. + aStream nextPutAll: 'An instance of '. class printNl. 1 to: instVars size do: [:i | - Transcript + aStream nextPutAll: ' '; nextPutAll: (instVars at: i); nextPutAll: ': '. (self instVarAt: i) printNl]. - Transcript + aStream nextPutAll: ' contents: ['; nl. self associationsDo: [:obj | - Transcript + aStream nextPutAll: ' '; print: obj; nl]. - Transcript + aStream nextPutAll: ' ]'; nl ] diff --git a/kernel/Object.st b/kernel/Object.st index a4a44d5..4caafaa 100644 --- a/kernel/Object.st +++ b/kernel/Object.st @@ -700,8 +700,15 @@ All classes in the system are subclasses of me.'> "Print all the instance variables of the receiver on the Transcript" + self inspectOn: Transcript + ] + + inspectOn: aStream [ + "Print all the instance variables of the receiver on aStream" + + | instVars output object | - Transcript + aStream nextPutAll: 'An instance of '; print: self class; nl. @@ -719,16 +726,16 @@ All classes in the system are subclasses of me.'> object class name asString}]. i <= instVars size ifTrue: - [Transcript + [aStream nextPutAll: ' '; nextPutAll: (instVars at: i); nextPutAll: ': '] ifFalse: - [Transcript + [aStream nextPutAll: ' ['; print: i - instVars size; nextPutAll: ']: ']. - Transcript + aStream nextPutAll: output; nl] ] diff --git a/kernel/SeqCollect.st b/kernel/SeqCollect.st index 77ba039..e24c2f8 100644 --- a/kernel/SeqCollect.st +++ b/kernel/SeqCollect.st @@ -54,14 +54,13 @@ some access and manipulation methods.'> ^newInst ] - inspect [ - "Print all the instance variables and context of the receiver on the - Transcript" + inspectOn: aStream [ + "Print all the instance variables and context of the receiver on aStream" | instVars object output | self beConsistent. - Transcript + aStream nextPutAll: 'An instance of '; print: self class; nl. @@ -77,13 +76,13 @@ some access and manipulation methods.'> return: '%1 %2' % {object class article. object class name asString}]. - Transcript + aStream nextPutAll: ' '; nextPutAll: (instVars at: i); nextPutAll: ': '; nextPutAll: output; nl]. - Transcript + aStream nextPutAll: ' contents: ['; nl. self keysAndValuesDo: @@ -96,13 +95,13 @@ some access and manipulation methods.'> return: '%1 %2' % {obj class article. obj class name asString}]. - Transcript + aStream nextPutAll: ' ['; print: i; nextPutAll: ']: '; nextPutAll: output; nl]. - Transcript + aStream nextPutAll: ' ]'; nl ]