On Wed, Dec 05, 2001 at 12:18:53AM -0800, Brent Dax wrote: > I'm probably just inexperienced and idiotic, but what's wrong with > simple 'get_from_aggregate target, aggregate, key' and maybe > 'get_list_from_aggregate target_list, aggregate, key_list'? (Obviously > we'd shorten the names, but you get the idea.) target would be set to > the actual element, not just a copy of it, so setting that would set the > original.
This is not the whole picture as the elements of an aggregate do not always have associated vtables to compute with. Consider an array of native integers (or native doubles). If you 'get' an lvalue from it, you won't know the underlying type, so computing with it is messy unless you wrap the lvalue up in some type of reference PMC. Creating one to access every element of an array will create lots of extraneous temporaries. Using the aggregate's vtable is another way of getting the job done that avoids all the extra reference PMCs. However, references will have to be supported. -- Jason