|
![](/i/fill.gif) |
On 3/14/2012 15:34, Orchid Win7 v1 wrote:
> merely update its object table entry.
This is also important for the "becomes" operator.
In Smalltalk, if you have an array X of size 10 that you now want to be size
20, you can do something essentialy like this:
y := a new array of size 20.
copy first ten elements of x into y.
x becomes y
That last statement swaps the variables x and y, so that all former
references to x now point to y and vice versa. It's how smalltalk does the
equivalent of std::vector without actually having a header object and a
content object.
I've nver seen any other language do that.
> Most of this information is per-class rather than per-object, however.
And I suspect if your language is sufficiently strongly typed, you could
figure out the classes of non-variant data without having to add information
to the instances.
--
Darren New, San Diego CA, USA (PST)
People tell me I am the counter-example.
Post a reply to this message
|
![](/i/fill.gif) |