become: in VASmalltalk: one way or two way ?

32 views
Skip to first unread message

Marten Feldtmann

unread,
Jul 21, 2020, 11:22:06 AM7/21/20
to VA Smalltalk

The method remark says its platform dependent ... so how is it under VA ?

Mariano Martinez Peck

unread,
Jul 21, 2020, 11:28:34 AM7/21/20
to VA Smalltalk
Which version are you working with? Because this method has been clarified recently. In 9.2.2 it looks like this:

become: otherObject

"Change all objects that refer to the receiver (via

instance variables) to now refer to @otherObject.

This is termed 'one way' become. 


Fail if the receiver is a immediate object:

(anSmallInteger, a Character, true, false, nil)

 

Arguments:

otherObject - <Object>

Answers:

<Object> self"


<primitive: VMprObjectBecome>

^self primitiveFailed


On Tue, Jul 21, 2020 at 12:22 PM Marten Feldtmann <m.fel...@dimap.de> wrote:

The method remark says its platform dependent ... so how is it under VA ?

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to va-smalltalk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/e3cf4a3c-9abe-4ab8-a0cc-c9a7f9ee9d3dn%40googlegroups.com.


--
Mariano Martinez Peck
Software Engineer, Instantiations Inc.

Marten Feldtmann

unread,
Jul 21, 2020, 11:56:07 AM7/21/20
to VA Smalltalk
In my Windows 9.2.2 I have the following remark:

become: otherObject

    "Change all objects that refer to the receiver (via
     instance variables) to now refer to otherObject.

     The exact implementation of #become: is platform
     dependent. Some implementations may swap the
     references of the receiver and otherObject. This is
     termed 'two way' become. For 'two way' become, answer
     otherObject. Some implementations will only change
     the references that originally refer to the receiver
     leaving otherObject to be garbage collected. This is
     termed 'one way' become. For 'one way' become, Answer
     the changed receiver. A third alternative is 'one
     way' become, but Answer otherObject. The most
     conservative assumption is to assume 'one way' become.

     Fail if the receiver is a SmallInteger, a Character, true, false
     or nil."

    <primitive: VMprObjectBecome>
    ^self primitiveFailed

Mariano Martinez Peck

unread,
Jul 21, 2020, 11:58:34 AM7/21/20
to VA Smalltalk
Ups, sorry, my bad, that was integrated for the next release of VAST (not 922). Anyway, I think that answers your question ;)



Joachim Tuchel

unread,
Jul 22, 2020, 2:25:22 AM7/22/20
to VA Smalltalk
Hi Marten,

Reply all
Reply to author
Forward
0 new messages