From: Nobuyoshi Nakada Date: 2008-03-15T10:03:29+09:00 Subject: Re: RARRAY_PTR Hi, At Sat, 15 Mar 2008 09:40:15 +0900, Laurent Sansonetti wrote in [ruby-core:15909]: > I think this macro is dangerous because it exposes too much internals. You mean it has no boundary check? > Also, it is difficult to re-implement RArray using a different storage > structure and efficiently support this macro at the same time. In > MacRuby I am working on a new implementation of the Array class and > will not be able to support this macro for inline modifications. What kind of structure? > I therefore suggest to introduce the following macros: > > RARRAY_GET_AT(ary, idx) ... > RARRAY_SET_AT(ary, idx, value) ... I thought another macro, RARRAY_AT(ary, idx) which ensures ary has extent enough for idx and returns the corresponding pointer. This would solve your first issue, but I'm not sure about the second. In extensions, we often have needed some VALUEs' area, instead just getting from/setting to an entry. -- Nobu Nakada