[Pharo-project] ObjectScanner

Mariano Martinez Peck marianopeck at gmail.com
Fri Oct 22 07:47:13 EDT 2010

Seems to be used by SmartRefStream, but I don't know why. But it is easy to
test it.

This works:

    FileStream forceNewFileNamed: 'test' do:
        [ :stream |  stream fileOutClass: nil andObject: 'something'.

    (FileStream oldFileNamed: 'test') fileInObjectAndCode.

Rename ObjectScanner, and you will get a compiler error.
This is because it is being written in:

SmartRefStream >> appendClassDefns

The ObjectScanner class comment says:

An instance of this class is the compiler's context for filing in a
SmartRefStream containing instance-specific classes.  When the old name of a
new object's class conflicts with an existing class name, install a class
var in me.  It has the old name but points at the new class.  The compiler
uses it when compiling the code in the fileIn.  Fill the SmartRefStream's
renamed class dictionary.

An object fileout:
!ObjectScanner new initialize!      "allow me to take control with

Player subclass: Player23 instanceVariableNames: 'foo' classVariableNames:
    poolDictionaries: nil category: 'Instance Specific'!
    "I prescan this and (self rename: #Player23 toBe: #Player30)"

!Player23 methodsFor: 'all' stamp: 'tk 3/9/98 18:58'!    "actually sent to
    ^ foo! !

!self smartRefStream!<binary representation of the objects>!

On Thu, Oct 21, 2010 at 8:10 PM, stephane ducasse
<stephane.ducasse at free.fr>wrote:

> ObjectScanner does not have any user and I was wondering what was its exact
> purpose?
> Apparently it is related to uniclasses and there are still some left over.
> It is not available in CUIS.
> Stef
> _______________________________________________
> Pharo-project mailing list
> Pharo-project at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20101022/fbedbcfb/attachment-0001.html>

More information about the Pharo-dev mailing list