You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let mut positions = [Zero::zero (), ..ObjectAmount];
for uint::range (0, positions.len ()) |ii| {
positions[ii] = do objects[ii].position
}
(2)
let positions = do objects.map |object| { object.position }
Code example number (2) looks much prettier than code example (1) but is incorrect, as it returns a dynamically sized array. The code returns a dynamically sized array because the objects array is coerced to a dynamically sized array, and then the map method is called on the dynamic array. Can some method of making code sample number (2) happen be implemented? Right now, the behaviour is unintuitive, and annoying.