fn collection_id(val: &RValue) -> Result<usize, RError>
Extract a collection ID from an RValue (integer scalar, possibly with a class attribute).