lua-users home
lua-l archive

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


Waldemar Celes <celes@tecgraf.puc-rio.br> wrote:
> I am considering to use string, instead of a special C type,
> but I am still not sure that's the best choice.
> 
> I decided to use a special type because I have to provide special
> functions to manipulate the buffer anyway.
> If you use GL_BYTE type, you can manipulate a buffer as a conventional
> string, but for different types (GL_SHORT, GL_FLOAT, etc) you need
> special functions.

I see. Would it be possible to write those special functions to 
manipulate strings instead of a special C type?
Something like:

string = bitor(string1, string2)
string = bitand(string1, string2)
string = bitxor(string1, string2)
string = bitshift(string1, number)
string = bitinvert(string1)

(or have the operations apply to the string in-place)

It would be great if these(or some similiar bitwise string functions)
could be made a standard part of Lua:

Steve