Problems with SmartRefStream

Albert Sacks gtg913h at mail.gatech.edu
Sat Nov 6 22:12:53 UTC 2004


I'm having trouble with SmartRefStream. I created the following class:

Object subclass: #Test
	instanceVariableNames: 'Bar Foo '
	classVariableNames: ''
	poolDictionaries: ''
	category: 'ALTEST'!

!Test methodsFor: 'as yet unclassified' stamp: 'AWS 11/6/2004 16:27'!
bar
	^ Bar! !

!Test methodsFor: 'as yet unclassified' stamp: 'AWS 11/6/2004 16:27'!
foo
	^Foo! !

!Test methodsFor: 'as yet unclassified' stamp: 'AWS 11/6/2004 16:09'!
input
	"comment stating purpose of message"

	| strem |
	strem _ SmartRefStream fileNamed: 'MyModel.obj'.
	Foo _ strem next.
	Bar _ strem next.
	strem close.! !

!Test methodsFor: 'as yet unclassified' stamp: 'AWS 11/6/2004 16:08'!
output
	"comment stating purpose of message"

	| strem |
	strem _ SmartRefStream fileNamed: 'MyModel.obj'.
	strem nextPut: Foo.
	strem nextPut: Bar.
	strem close! !

!Test methodsFor: 'as yet unclassified' stamp: 'AWS 11/6/2004 16:23'!
setup
	"comment stating purpose of message"

	| |
	Foo _ Dictionary new.
	Bar _ Dictionary new.
	Foo at: #Bob put: #Jones.
	Foo at: #O put: Bar.
	Bar at: #Bob put: #Smith.
	Bar at: #O put: Foo.! !

to practice using SmartRefStreams.
Unfortunately, when I try to use "input" it gives an error. Apparently 
when the file is loaded,
the type dictionary is represented as "39" when SmartRefStream checks 
the type, and
the RefTypes collection in ReferenceStream doesn't seem to have an 
element 39.

You can check the error log for yourself with
FooBar := new Test.
FooBar setup.
FooBar output. "works up to here"
FooBar input. "error here"




More information about the Squeak-dev mailing list