Re: # on known length ffi array

  • From: Justin Cormack <justin@xxxxxxxxxxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sat, 9 Jun 2012 04:05:23 +0100

On Sat, Jun 9, 2012 at 12:00 AM, Justin Cormack <
justin@xxxxxxxxxxxxxxxxxxxxx> wrote:

>
> Would it be possible for the # operator to work on known length C arrays?
> (not VLAs or cast pointers obviously). eg if I have a = ffi.new("int[8]")
> then #a == 8.
>
> It would make array returns a bit more array like in Lua (obviously 0
> based).
>
> Just a thought... probably reasons why not...
>

Actually I think it is going to be easier to wrap array-like returns in an
iterator, will try that instead and see how it goes, as this will be pretty
limiting even if it worked...

Justin

Other related posts: