SIXX - Smalltalk Instance eXchange in XML
Last updated at 6:35 pm UTC on 20 August 2020
SIXX allows you to exchange nets of Smalltalk objects between Squeak, Pharo, Cuis, VW and Dolphin Smalltalk.
homepage:
http://www.mars.dti.ne.jp/~umejava/smalltalk/sixx/index.html
SqueakMap entry
Squeak 5.3
https://github.com/mumez/SIXX
Squeak 5.0
Loads and works fine in Squeak 5.0 through SqueakMap.
Version for Pharo
http://live.exept.de/doc/online/english/programming/goody_sixx.html
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';
configuration;
load.
(Smalltalk at: #ConfigurationOfSIXX) perform: #load.
Needs two small fix as of December 2015
SixxPortableUtil>>writeFileStreamNamed:
has to be changed to
writeFileStreamNamed: aFilename
"#Pharo Specific#"
^aFilename asFileReference writeStream
SixxPortableUtil>>readFileStreamNamed:
has to be changed to
readFileStreamNamed: aFilename
"#Pharo Specific#"
^aFilename asFileReference writeStream
http://pharo.gemtalksystems.com/book/PharoTools/SIXX/
Examples
example1
"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.
^xmlString
example2
"SixxExamples example2"
"Read a SIXX string and restore an instance (like #readFrom:)"
| xmlString obj |
xmlString := SixxExamples example1.
obj := Object readSixxFrom: xmlString.
obj inspect.
example5
"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.
example6
"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
SISS
Smalltalk Interchange File (SIF)