[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Sequence of bytes - userdata or string?
- From: Dirk Laurie <dirk.laurie@...>
- Date: Wed, 4 Jan 2012 17:20:06 +0200
2012/1/4 Asim <asim.r.p@gmail.com>:
>
> I want to write a C function that returns a sequence of bytes. This
> function should be called from Lua. There are two options for the type of
> return value in Lua - userdata and string.
>
Your main concern should be clarity, not speed. Is it conceivable
that you would wish to concatenate two of your bytesequences to form a
third? If yes, by all means return a string. If no, do it as
userdata.