User Tools

Site Tools


admin:shapechange

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
admin:shapechange [2012/05/14 11:52] – created jwarrioradmin:shapechange [2013/05/19 11:58] (current) jwarrior
Line 1: Line 1:
 +====== Shape Change ======
  
 +2013/05/12. This works. See also TestDuration class>>dumpedObjectAsLiteralString:.
 +
 +The mutate:* method goes on the __Class__ side!
 +
 +<code>
 + | stream byteArray dt |
 +
 + dt := DateAndTime year: 1989 day: 240 hour: 05 minute: 04  second: 03. 
 + stream := ReadWriteStream on: ByteArray new.
 + ObjectDumper new unload: dt intoStream: stream.
 + byteArray := stream contents.
 +
 + stream := WriteStream on: (String new: 2000).
 + stream nextPutAll: '#('.
 + byteArray doWithIndex: [:byte :i |
 + i \\ 30 = 0 ifTrue: [stream cr].
 + byte printOn: stream.
 + i = byteArray size ifFalse: [stream space]].
 + stream nextPut: $).
 +
 + stream contents
 +</code>
 +
 +