Administrator
|
[Instantiations, please be sure to preserve this functionality if you don't implement an official two-way become.]
-- In porting GBS functionality from VisualWorks to VA Smalltalk, I needed two-way become support. Mark van Gulik posted an algorithm by which one can simulate two-way become using a one-way become (see below), but it required two copy operations and two separate become operations. It turns out the #multiBecome: will do a two-way become if you convert a,b to b,a. Example:
Mark's explanation of how to do it using brute force: Just as a curiosity, simulating a two-way become with a one-way become 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 [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Administrator
|
By the way, the following is not complete. The VA Smalltalk #become: and #multiBecome: do not swap the #basicHash of the objects (which would break their use in hashed collections). So be sure to save and reset/swap their hashes in any "become" operation in VA Smalltalk.
-- On Tuesday, September 30, 2014 9:14:39 AM UTC-7, Richard Sargent wrote:
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 [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Hi Richard,
-- Yes, we plan to preserve the functionality we have. For next release we will review basicHash swapping. I would like to understand the rationale behind the decision that was made originally not to do it...and what happens (if anything) if we do. I found this old thread (http://forum.world.st/identityHash-and-become-question-td1404098.html) as a start for research. I don't have much time at the moment to dig deeper, but as I said, it will be revisited. If you have additional thoughts on the matter, I will be sure to include that in the discussion. Thanks. -- Seth On Tuesday, September 30, 2014 12:37:04 PM UTC-4, Richard Sargent wrote:
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 [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Administrator
|
On Wednesday, October 1, 2014 12:25:27 PM UTC-7, Seth Berman wrote:
--
Thanks, Seth. That was a very interesting and - I think - enlightening reference. It may well be that my changing their identity hashes when I swap them is actually creating problems for me. I'll have to check this out carefully. [I don't know about anyone else, but for me, "reasoning" about #become: is very difficult! :-)] 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 [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
+1 on reasoning about #become:)
-- On Wednesday, October 1, 2014 3:46:58 PM UTC-4, Richard Sargent wrote:
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 [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Administrator
|
In reply to this post by Richard Sargent
On Wednesday, October 1, 2014 12:46:58 PM UTC-7, Richard Sargent wrote:
--
Well, not swapping the basic hashes definitely breaks their use in hashed collections. It is desirable that the reference held in an identity hashed collection should retain the identity hash it had when it was inserted into the collection. 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 [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Free forum by Nabble | Edit this page |