links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
SIXX - Smalltalk Instance eXchange in XML
Last updated at 12:38 pm UTC on 5 January 2016
SIXX allows you to exchange nets of Smalltalk objects between Squeak, VW and Dolphin Smalltalk.


SqueakMap entry

Loads and works fine in Squeak 5.0 through SqueakMap.

Version for Pharo

Load into Squeak

Installer squeaksource
    project: 'MetacelloRepository';
    install: 'ConfigurationOfSIXX'.
   ((Smalltalk at: #ConfigurationOfSIXX) project version: '0.4.1') load.

Load into Pharo 5.0

Gofer it
    smalltalkhubUser: 'MasashiUmezawa' project: 'SIXX';
(Smalltalk at: #ConfigurationOfSIXX) perform: #load.

Needs two small fix as of December 2015

has to be changed to

 writeFileStreamNamed: aFilename
        "#Pharo Specific#"
        ^aFilename asFileReference writeStream


has to be changed to

 readFileStreamNamed: aFilename
	 "#Pharo Specific#"
        ^aFilename asFileReference writeStream



	"SixxExamples example1"
	"Create a SIXX string from an object (like #storeString)"
	| dict array xmlString |
	dict := Dictionary new.
	dict at: #Smalltalk put: 'Best'.
	dict at: #Ruby put: 'Cool'.
	dict at: #Java put: 'Forget it'.
	array := Array new:3.
	array at: 1 put: 'Language Impressions'.
	array at: 2 put: dict.
	array at: 3 put: Date today.
	xmlString := array sixxString.
	Transcript cr; show: '##This is sixx xml instance##'. 
	Transcript cr; show: xmlString.

	"SixxExamples example2"
	"Read a SIXX string and restore an instance (like #readFrom:)"
	| xmlString obj |
	xmlString := SixxExamples example1.
	obj := Object readSixxFrom: xmlString.
	obj inspect. 

	"SixxExamples example5"
	"Write object data to an external file"
	| sws |
	sws := SixxWriteStream newFileNamed: ('obj.sixx').
	sws nextPut: Color random.
	sws nextPut: Rectangle fromUser.
	sws nextPut: Model subclasses.
	sws nextPutAll: Model subclasses. "note the differences"
	sws close.

	"SixxExamples example6"
	"Read object data from an external file"
	| srs objects |
	srs := SixxReadStream readOnlyFileNamed: ('obj.sixx').
	objects := OrderedCollection new.
	[srs atEnd] whileFalse: [objects add: srs next].
	srs close.
	objects inspect.

There are more examples in class SIXXExamples

See also

Smalltalk Interchange File (SIF)