> If you want your program to spawn objects during runtime you'll need ref 
> objects.

Not really. For example, when you have a single value object and add() it to a 
seq, it is copied -- similar as C++ vector does copy when you use 
std::vector::push_back(). You can modify your value object then, and add next 
copy. Similar for other data structures like hash or tree. Of course seq uses a 
internal buffer allocated dynamically on heap, but we may not really notice 
that.

kcvinu, of course you can use ref objects and inheritance for GUI stuff and 
much more. Ref objects are less efficient due to indirection of course, you 
have the ref on the stack, which points to the data on the heap, which is most 
often not in cache. That may make a difference of a few 100 clock cycles, which 
is less than 100 ns. May be much for high performance computing and games, not 
that much for us ordinary people.

Reply via email to