<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16711" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>:-)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I just compiled with:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> (twoWayFlag not and: [copyHashFlag
not])<BR> ifTrue: [(self containOnlyOops: array1) ifFalse:
[^false]]<BR> ifFalse: [(self containOnlyOops: array1 and: array2)
ifFalse: [^false]].<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>but I like your positive logic better.
Thanks!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Rob</DIV></FONT>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=eliot.miranda@gmail.com href="mailto:eliot.miranda@gmail.com">Eliot
Miranda</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=squeak-dev@lists.squeakfoundation.org
href="mailto:squeak-dev@lists.squeakfoundation.org">The general-purpose Squeak
developers list</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, September 18, 2008 12:41
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [squeak-dev] Re:
becomeForward: alternative</DIV>
<DIV><BR></DIV>
<DIV dir=ltr>Things work fine provided the become is one-way and hashes are
not copied. Simply change
<DIV><BR></DIV>
<DIV> (self containOnlyOops: array1 and:
array2) ifFalse: [^false]</DIV>
<DIV><BR></DIV>
<DIV>in ObjectMemory>>become:with:twoWay:copyHash: to<BR>
<DIV><BR></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>(twoWayFlag
or: [copyHashFlag])</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>ifTrue: [(self
containOnlyOops: array1 and: array2) ifFalse: [^false]]</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>ifFalse:
[(self containOnlyOops: array1) ifFalse: [^false]].</DIV>
<DIV><BR></DIV>
<DIV>along with the obvious implementation of containOnlyOops:.</DIV>
<DIV>If so,</DIV>
<DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>| foo bar
|</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>foo :=
1@2.</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>bar := { foo.
foo }.</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>foo
becomeForward: 0 copyHash: false.</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>{ foo. bar
}</DIV>
<DIV>produces</DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>#(0 #(0
0))</DIV></DIV>
<DIV><BR></DIV>
<DIV class=gmail_quote>On Thu, Sep 18, 2008 at 9:09 AM, Rob Withers <SPAN
dir=ltr><<A
href="mailto:reefedjib@yahoo.com">reefedjib@yahoo.com</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><BR>-----
Original Message ----- From: "Paolo Bonzini" <<A
href="mailto:bonzini@gnu.org" target=_blank>bonzini@gnu.org</A>><BR>To:
"The general-purpose Squeak developers list" <<A
href="mailto:squeak-dev@lists.squeakfoundation.org"
target=_blank>squeak-dev@lists.squeakfoundation.org</A>><BR>Sent:
Tuesday, September 16, 2008 3:59 PM<BR>Subject: [squeak-dev] Re:
becomeForward: alternative
<DIV>
<DIV></DIV>
<DIV class=Wj3C7c><BR><BR><BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Rob
Withers wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I
am trying to becomeForward with an object and a small integer.
This<BR>of course doesn't work. Is there an alternative that
would allow me to<BR>do this?<BR></BLOCKQUOTE><BR>There's actually no
reason why the *destination* of a becomeForward:<BR>cannot be a
SmallInteger. It's a VM bug in my
opinion.<BR><BR></BLOCKQUOTE><BR></DIV></DIV>Thanks, Paolo.<BR><BR>I tried
looking into this a bit and here is what I have found. First off, this
will only work with<BR> #elementsForwardIdentityTo:
anArrayWithSmallIntegers copyHash: false.<BR>It would not work to copy the
source hash to a SmallInteger.<BR><BR>Next is understanding forwarding
blocks and the process of remapping objects using them. There are
three steps:<BR> 1) #prepareForwardingTableForBecoming:with:twoWay:
"create and init forwarding blocks, and install into original
headers"<BR> 2) #mapPointersInObjectsFrom:to: "point pointers to
forwarded oop"<BR> 3) #restoreHeadersAfterForwardBecome: "restore
original headers"<BR>The question seems to come down to the following.
Can forwarding blocks point to SmallIntegers?<BR><BR>Rob<BR><BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Paolo<BR><BR></BLOCKQUOTE><BR><BR></BLOCKQUOTE></DIV><BR></DIV></DIV>
<P>
<HR>
<P></P><BR></BLOCKQUOTE></BODY></HTML>