lua-users home
lua-l archive

function call as lvalue

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi All,
I guess the most likely answer to this question is 'No', but just in case. Is there a way to implement in C a function call as an lvalue? Basically, I want my Lua program to be able to do something like this:
 m = mymessage.create()
 m.byte(1).bits(2, 3) = 2
I know I can implement something like this:
 m.byte(1).bits(2, 3).set(2)
or this:
 m.byte[1].bits[2][3] = 2
But the former looks more elegant to me :)
Cheers,
Sandy

AltStyle によって変換されたページ (->オリジナル) /