From: Bardur A. <sp...@sc...> - 2005-03-05 23:58:30
|
Alain Frisch wrote: >>> Why don't you use the element you add (in ::) and an equivalent of >>> Array.map (in map) ? (Array.map as it is would produce a different >>> traversal order >>> for the vlists) >> >> I'm not sure I follow... Once you have a pointer into the list (ie. >> the parameter you're calling VList.map with) everything back from that >> point is read-only, so you don't to construct anything using (::)...?!? > > I mean, instead of putting a dummy value (__NULL__ ()) when you allocate > in new block in (::), you could use the first argument of (::) as the > initializer for the array. And it has the correct type, by definition. > So if you create vlists of floats, the arrays will end up being real > arrays of floats (with inlined floats), not arrays of boxed floats. Ah, got ya. I think there *might* be a problem with doing this. I don't remember the details right now, but I do remember being quite sure it was actually necessary to fill up using NULLs instead of copies. (Obviously it had something to do with the extra references causing objects to hang around for longer than necessary). Actually, I'm not so sure that it is actually necessary, right now. I'll examine it more closely tomorrow. > Really, there is no need to use unsafe features here. Be on the safe > side ! (and it will be more efficient for float vlists) Of course, I'd like to avoid them, but I was sure I needed the NULLs at the time of implementation... that may change tomorrow. :) Cheers, -- Bardur Arantsson <ba...@im...> <ba...@sc...> Thank you very little. |