POV-Ray : Newsgroups : povray.off-topic : A tale of two cities : Re: A tale of two cities Server Time
29 Jul 2024 16:31:39 EDT (-0400)
  Re: A tale of two cities  
From: Darren New
Date: 14 Mar 2012 23:47:26
Message: <4f61664e$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.