The Inbox: Collections-ul.345.mcz

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

The Inbox: Collections-ul.345.mcz

commits-2
A new version of Collections was added to project The Inbox:
http://source.squeak.org/inbox/Collections-ul.345.mcz

==================== Summary ====================

Name: Collections-ul.345
Author: ul
Time: 22 March 2010, 8:20:09.398 am
UUID: 3384c567-0abc-5346-a752-bbd3ac938e44
Ancestors: Collections-nice.343

- implement #backChunk with #back instead of #oldBack

=============== Diff against Collections-nice.343 ===============

Item was changed:
  ----- Method: PositionableStream>>backChunk (in category 'fileIn/Out') -----
  backChunk
  "Answer the contents of the receiver back to the previous terminator character.  Doubled terminators indicate an embedded terminator character."
 
+ | output character |
+ output := WriteStream on: (String new: 1000).
+ self back. "oldBack compatibility"
+ [ (character := self back) == nil ] whileFalse: [
+ character == $!! ifTrue: [
+ self back == $!! ifFalse: [
+ self skip: 2. "oldBack compatibility"
+ ^output contents reversed ] ].
+ output nextPut: character].
+ self skip: 1. "oldBack compatibility"
+ ^output contents reversed!
- | terminator out ch |
- terminator := $!!.
- out := WriteStream on: (String new: 1000).
- [(ch := self oldBack) == nil] whileFalse:
- [ch == terminator
- ifTrue:
- [self peekBack == terminator
- ifTrue: [self oldBack "skip doubled terminator"]
- ifFalse: [^ out contents reversed]].
- out nextPut: ch].
- ^ out contents reversed!