Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.580.mcz
==================== Summary ====================
Name: Collections-nice.580
Author: nice
Time: 28 July 2014, 10:42:04.046 pm
UUID: 5f8aabc7-d706-48e6-8d68-e591c6d00176
Ancestors: Collections-nice.579
peekLast commit and try again...
=============== Diff against Collections-nice.579 ===============
Item was changed:
----- Method: RWBinaryOrTextStream>>peekLast (in category 'accessing') -----
peekLast
"Return that item just put at the end of the stream"
^ position > 0
ifTrue: [self isBinary
+ ifTrue: [(collection at: position) asInteger]
+ ifFalse: [(collection at: position) asCharacter]]
- ifTrue: [(collection at: position) asCharacter]
- ifFalse: [(collection at: position) asInteger]]
ifFalse: [nil]!
Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.580.mcz
==================== Summary ====================
Name: Collections-nice.580
Author: nice
Time: 28 July 2014, 10:42:04.046 pm
UUID: 5f8aabc7-d706-48e6-8d68-e591c6d00176
Ancestors: Collections-nice.579
peekLast commit and try again...
=============== Diff against Collections-nice.579 ===============
Item was changed:
----- Method: RWBinaryOrTextStream>>peekLast (in category 'accessing') -----
peekLast
"Return that item just put at the end of the stream"
^ position > 0
ifTrue: [self isBinary
+ ifTrue: [(collection at: position) asInteger]
+ ifFalse: [(collection at: position) asCharacter]]
- ifTrue: [(collection at: position) asCharacter]
- ifFalse: [(collection at: position) asInteger]]
ifFalse: [nil]!
Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.579.mcz
==================== Summary ====================
Name: Collections-nice.579
Author: nice
Time: 28 July 2014, 10:32:31.105 pm
UUID: ef7ba0ca-4d01-4aac-9236-a968a13d7eae
Ancestors: Collections-eem.578
Implement #peekLast in RWBinaryOrTextStream because it has to care whether isBinary or not.
=============== Diff against Collections-eem.578 ===============
Item was added:
+ ----- Method: RWBinaryOrTextStream>>peekLast (in category 'accessing') -----
+ peekLast
+ "Return that item just put at the end of the stream"
+
+ ^ position > 0
+ ifTrue: [self isBinary
+ ifTrue: [(collection at: position) asCharacter]
+ ifFalse: [(collection at: position) asInteger]]
+ ifFalse: [nil]!
Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.579.mcz
==================== Summary ====================
Name: Collections-nice.579
Author: nice
Time: 28 July 2014, 10:32:31.105 pm
UUID: ef7ba0ca-4d01-4aac-9236-a968a13d7eae
Ancestors: Collections-eem.578
Implement #peekLast in RWBinaryOrTextStream because it has to care whether isBinary or not.
=============== Diff against Collections-eem.578 ===============
Item was added:
+ ----- Method: RWBinaryOrTextStream>>peekLast (in category 'accessing') -----
+ peekLast
+ "Return that item just put at the end of the stream"
+
+ ^ position > 0
+ ifTrue: [self isBinary
+ ifTrue: [(collection at: position) asCharacter]
+ ifFalse: [(collection at: position) asInteger]]
+ ifFalse: [nil]!
Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.579.mcz
==================== Summary ====================
Name: Collections-nice.579
Author: nice
Time: 28 July 2014, 10:32:31.105 pm
UUID: ef7ba0ca-4d01-4aac-9236-a968a13d7eae
Ancestors: Collections-eem.578
Implement #peekLast in RWBinaryOrTextStream because it has to care whether isBinary or not.
=============== Diff against Collections-eem.578 ===============
Item was added:
+ ----- Method: RWBinaryOrTextStream>>peekLast (in category 'accessing') -----
+ peekLast
+ "Return that item just put at the end of the stream"
+
+ ^ position > 0
+ ifTrue: [self isBinary
+ ifTrue: [(collection at: position) asCharacter]
+ ifFalse: [(collection at: position) asInteger]]
+ ifFalse: [nil]!
Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.578.mcz
==================== Summary ====================
Name: Collections-eem.578
Author: eem
Time: 28 July 2014, 9:59:54.044 am
UUID: 5ecf4e5c-8071-4cba-b887-144271ecfa61
Ancestors: Collections-nice.577
Implement peekLast in TranscriptStream.
Implement WriteStream>>ensureEndsWith: in terms of peekLast.
=============== Diff against Collections-nice.577 ===============
Item was removed:
- ----- Method: TranscriptStream>>ensureEndsWith: (in category 'accessing') -----
- ensureEndsWith: anObject
- "Append anObject to the receiver IFF there is not one on the end."
-
- lastChar = anObject ifTrue: [^self].
- super ensureEndsWith: anObject!
Item was added:
+ ----- Method: TranscriptStream>>peekLast (in category 'character writing') -----
+ peekLast
+ "Return that item just put at the end of the stream"
+
+ ^ position > 0
+ ifTrue: [collection at: position]
+ ifFalse: [lastChar]!
Item was changed:
----- Method: WriteStream>>ensureEndsWith: (in category 'accessing') -----
ensureEndsWith: anObject
"Append anObject to the receiver IFF there is not one on the end."
+ self peekLast = anObject ifFalse:
+ [self nextPut: anObject]!
- (position > 0 and: [(collection at: position) = anObject]) ifTrue: [^self].
- self nextPut: anObject!
Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.578.mcz
==================== Summary ====================
Name: Collections-eem.578
Author: eem
Time: 28 July 2014, 9:59:54.044 am
UUID: 5ecf4e5c-8071-4cba-b887-144271ecfa61
Ancestors: Collections-nice.577
Implement peekLast in TranscriptStream.
Implement WriteStream>>ensureEndsWith: in terms of peekLast.
=============== Diff against Collections-nice.577 ===============
Item was removed:
- ----- Method: TranscriptStream>>ensureEndsWith: (in category 'accessing') -----
- ensureEndsWith: anObject
- "Append anObject to the receiver IFF there is not one on the end."
-
- lastChar = anObject ifTrue: [^self].
- super ensureEndsWith: anObject!
Item was added:
+ ----- Method: TranscriptStream>>peekLast (in category 'character writing') -----
+ peekLast
+ "Return that item just put at the end of the stream"
+
+ ^ position > 0
+ ifTrue: [collection at: position]
+ ifFalse: [lastChar]!
Item was changed:
----- Method: WriteStream>>ensureEndsWith: (in category 'accessing') -----
ensureEndsWith: anObject
"Append anObject to the receiver IFF there is not one on the end."
+ self peekLast = anObject ifFalse:
+ [self nextPut: anObject]!
- (position > 0 and: [(collection at: position) = anObject]) ifTrue: [^self].
- self nextPut: anObject!
Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.578.mcz
==================== Summary ====================
Name: Collections-eem.578
Author: eem
Time: 28 July 2014, 9:59:54.044 am
UUID: 5ecf4e5c-8071-4cba-b887-144271ecfa61
Ancestors: Collections-nice.577
Implement peekLast in TranscriptStream.
Implement WriteStream>>ensureEndsWith: in terms of peekLast.
=============== Diff against Collections-nice.577 ===============
Item was removed:
- ----- Method: TranscriptStream>>ensureEndsWith: (in category 'accessing') -----
- ensureEndsWith: anObject
- "Append anObject to the receiver IFF there is not one on the end."
-
- lastChar = anObject ifTrue: [^self].
- super ensureEndsWith: anObject!
Item was added:
+ ----- Method: TranscriptStream>>peekLast (in category 'character writing') -----
+ peekLast
+ "Return that item just put at the end of the stream"
+
+ ^ position > 0
+ ifTrue: [collection at: position]
+ ifFalse: [lastChar]!
Item was changed:
----- Method: WriteStream>>ensureEndsWith: (in category 'accessing') -----
ensureEndsWith: anObject
"Append anObject to the receiver IFF there is not one on the end."
+ self peekLast = anObject ifFalse:
+ [self nextPut: anObject]!
- (position > 0 and: [(collection at: position) = anObject]) ifTrue: [^self].
- self nextPut: anObject!
Nicolas Cellier uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-nice.299.mcz
==================== Summary ====================
Name: Graphics-nice.299
Author: nice
Time: 28 July 2014, 12:17:36.812 pm
UUID: 571c7dc6-b3c2-45cd-8a70-372784b82f72
Ancestors: Graphics-nice.298
Continue cleaning of RWBinaryOrTextStream reset uggliness:
- don't reset the stream in ImageReadWriter initialization (>>on:)
- reset the stream after sending #understandsImageFormat:
- make sure the stream is still binary after the reset in JPEGReadWriter class>>understandsImageFormat: - NOTE: from what I understand, RWBinaryOrTextStream and it's Multi alternative are those loosing the binary property, not FileStream... These swiss knife streams are really a next of undue complexity. This workaround should go away when we finally get rid of them.
=============== Diff against Graphics-nice.298 ===============
Item was changed:
----- Method: ImageReadWriter class>>formFromStream: (in category 'image reading/writing') -----
formFromStream: aBinaryStream
"Answer a ColorForm stored on the given stream. closes the stream"
| reader readerClass form |
readerClass := self withAllSubclasses
detect: [:subclass | subclass understandsImageFormat: aBinaryStream]
ifNone: [
aBinaryStream close.
^self error: 'image format not recognized'].
+ aBinaryStream reset.
reader := readerClass new on: aBinaryStream.
Cursor read showWhile: [
form := reader nextImage.
reader close].
^ form
!
Item was changed:
----- Method: ImageReadWriter>>on: (in category 'private') -----
on: aStream
+ stream := aStream.
+ stream binary.!
- (stream := aStream) reset.
- stream binary.
- "Note that 'reset' makes a file be text. Must do this after."!
Item was changed:
----- Method: JPEGReadWriter class>>understandsImageFormat: (in category 'image reading/writing') -----
understandsImageFormat: aStream
(JPEGReadWriter2 understandsImageFormat: aStream) ifTrue:[^false].
+ aStream reset; binary.
- aStream reset.
aStream next = 16rFF ifFalse: [^ false].
aStream next = 16rD8 ifFalse: [^ false].
^true!
Nicolas Cellier uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-nice.299.mcz
==================== Summary ====================
Name: Graphics-nice.299
Author: nice
Time: 28 July 2014, 12:17:36.812 pm
UUID: 571c7dc6-b3c2-45cd-8a70-372784b82f72
Ancestors: Graphics-nice.298
Continue cleaning of RWBinaryOrTextStream reset uggliness:
- don't reset the stream in ImageReadWriter initialization (>>on:)
- reset the stream after sending #understandsImageFormat:
- make sure the stream is still binary after the reset in JPEGReadWriter class>>understandsImageFormat: - NOTE: from what I understand, RWBinaryOrTextStream and it's Multi alternative are those loosing the binary property, not FileStream... These swiss knife streams are really a next of undue complexity. This workaround should go away when we finally get rid of them.
=============== Diff against Graphics-nice.298 ===============
Item was changed:
----- Method: ImageReadWriter class>>formFromStream: (in category 'image reading/writing') -----
formFromStream: aBinaryStream
"Answer a ColorForm stored on the given stream. closes the stream"
| reader readerClass form |
readerClass := self withAllSubclasses
detect: [:subclass | subclass understandsImageFormat: aBinaryStream]
ifNone: [
aBinaryStream close.
^self error: 'image format not recognized'].
+ aBinaryStream reset.
reader := readerClass new on: aBinaryStream.
Cursor read showWhile: [
form := reader nextImage.
reader close].
^ form
!
Item was changed:
----- Method: ImageReadWriter>>on: (in category 'private') -----
on: aStream
+ stream := aStream.
+ stream binary.!
- (stream := aStream) reset.
- stream binary.
- "Note that 'reset' makes a file be text. Must do this after."!
Item was changed:
----- Method: JPEGReadWriter class>>understandsImageFormat: (in category 'image reading/writing') -----
understandsImageFormat: aStream
(JPEGReadWriter2 understandsImageFormat: aStream) ifTrue:[^false].
+ aStream reset; binary.
- aStream reset.
aStream next = 16rFF ifFalse: [^ false].
aStream next = 16rD8 ifFalse: [^ false].
^true!