On Sat, Aug 4, 2012 at 1:35 PM, Philipp Kutin <philipp.kutin@xxxxxxxxx>wrote: > > Something like this would be great, but I don't see how it's possible > with the FFI API. There's ffi.cast, but it's described as working only > for scalars, and indeed, LuaJIT complains when I try to feed it the > example I posted: > A pointer is a scalar. Although, I don't really see the point of this. The user can do all manner of bad things with FFI types, with or without const on the variables. No hand-holding.