On Fri, Feb 19, 2010 at 12:35 AM, Sheridan Mahoney <sheridan@sheridan-mahoney.com> wrote:

Hi all,

I've been catching up on ImageSegment news, and came across this old post
from January,
and got interested in discovering the mindset behind the outPointers array.
I re-ran
Mariano's original test code, with a small change: �turned 'Object new' into
TestOutPointers, a new
subclass of Object, with 2 inst vars and one method. �I'd be interested in
getting feedback on
whether my guesses (in quotes below) are in the ball park. �The results seem
to explain why
Association is not in outPointers - what is captured there in the case of
adding a class
is a lot like what you would need for filling in a class template. �If you
add an instance of a class,
you just need the name of the class.

Some comments I have gleaned from the ImageSegment class on outPointers :
This array contains:
� � � �- OOPs of all objects outside the segment that are pointed to from
inside segment.
� � � �- outPointers that are necessary to turn the bits in the file into objects.

Here's the code:

| segment external internal root |

� � external := TestOutpointers.
� � internal := true -> external.
� � root := false -> internal.
� � internal := nil.

� �segment := ImageSegment new
� � � � copyFromRoots: (Array with: root with: external)
� � � � sizeHint: 5000
� � � � areUnique: true.

ok
�^ (segment outPointers ) -> (segment arrayOfRoots )

I don't understand what is this return and why the association.


====== result =================
{ false. � � � � � � � � � � � � � � �"object outside the segment that is
pointed to from inside segment."
Object. � � � � � � � � � � � � � � �"superclass of TestOutpointers"
a MethodDictionary(#tryList->a CompiledMethod(1725:
TestOutpointers>>tryList) ) � � � "MethodDictionary"
#('iv1' 'iv2') � � � � � � � � � � � � "inst var names"
('testing' tryList) � � � � � � � � �"method category"
nil. � � � � � � � � � � � � � � � � � �"object outside the segment that is
pointed to from inside segment."
#TestOutpointers. � � � � � � � "symbol representing name of new class"
Smalltalk. � � � � � � � � � � � � �"environment that TestOutpointers is
assigned to"
#'IST-outPointers'. � � � � � � �"category name for TestOutpointers"
true. � � � � � � � � � � � � � � � � �"object outside the segment that is
pointed to from inside segment."
Metaclass. � � � � � � � � � � � � "for initializing class variables and
instance creation messages particular to a class."
Object class. � � � � � � � � � � �"class of TestOutpointers superclass"
ClassOrganizer. � � � � � � � � �"need this in order to determine whether
TestOutpointers has been changed in the local env"
#'as yet unclassified'. � � � � �"??"
}


For me this is ok. #'as yet unclassified'. � � � � �"??"�� in my case shows:

('as yet unclassified' xxxMethod)

where xxxMethod is the method I defined in TestOutPointers and 'as yet unclassified'� is because you didn't define any category to that method.

If you inspect ('as yet unclassified' xxxMethod) you will see it is a ClassOrganizer

I also attach a pdf I wrote about ImageSegment (is much more updated than the one I sent you months before).

Cheers

Mariano

->
{false->true->TestOutpointers. TestOutpointers}



Any feedback would be very welcome...

Cheers,
Sheri

--
View this message in context: http://n4.nabble.com/Something-I-don-t-understand-with-ImageSegments-tp1296982p1560990.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.

_______________________________________________
Pharo-project mailing list
Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project