Problems with SmartRefStream

Boris Gaertner Boris.Gaertner at gmx.net
Sun Nov 7 12:31:47 UTC 2004


From: "stéphane ducasse" <ducasse at iam.unibe.ch>


> I do not have the answer to your problem but instance variables are
> usually in lowercase letters in Smalltalk.
Yes, but instance variables with an uppercase first letter
should not cause problems.

To Albert:
I feel unable to explain all the do's and dont's of
SmartRefStream, but I think you should try this:

  | FooBar rr rr2 |
 FooBar :=  Test new.
 FooBar setup.
    "  file out  FooBar "
 rr _ ReferenceStream fileNamed: 'test.obj'.
 rr nextPut: FooBar.
 rr close.
    "  file it in again "
  rr2 _ ReferenceStream fileNamed: 'test.obj'.
 input _ rr2 next.
 rr2 close.
 input inspect


( In the inspector, *do not* select the option
'all inst vars'- the attempt to create a
printable representation of your test instance will
run forever, but that is a bug in the inspector
and YOU discovered it :-)  )
This works for me. (Both statements are copied from
the class comment of  ReferenceStream, the immediate
superclass of SmartRefStream )


Hope that helps
Boris




More information about the Squeak-dev mailing list