starwing / lbuffer Goto Github PK
View Code? Open in Web Editor NEWa mutable string support to lua.
a mutable string support to lua.
Hi,
I've successfully compiled and deployed lbuffer, but it does not work as expected under lua 5.3. it seems like 'append' and 'assign' are somehow missing:
$ lua5.3 -lbuffer
Lua 5.3.4 Copyright (C) 1994-2017 Lua.org, PUC-Rio
b = buffer "abc"
=b:set(2, "pple")
apple
=b:append "pie"
stdin:1: attempt to call a nil value (method 'append')
stack traceback:
stdin:1: in main chunk
[C]: in ?
=b:insert(-3, '-')
ap-ple
=b:assign "abc"
stdin:1: attempt to call a nil value (method 'assign')
stack traceback:
stdin:1: in main chunk
[C]: in ?
please advise
Hello,
I maintain Haxe support for the Lua target. I had wanted to use a Lua library for faster buffer manipulation. However, this proved difficult as I needed 0-based index support. I haven't had luck committing changes to support this into other relevant libraries, so I've gone ahead and forked your lbuffer lib and manually changed the index scheme. FWIW, this isn't a library that should be used by Lua developers, it's only meant to be used by the Haxe compiler.
I've given support and provided a link to your library here. Thanks for your work, it's much appreciated!
Hi! Your code looks quite useful and nice, but it gives funny warnings when compiled with Lua 5.4:
lbuffer.c: In function ‘write_int32’:
lbuffer.c:261:26: warning: this statement may fall through [-Wimplicit-fallthrough=]
261 | case 4: *s++ = (n >> 24) & 0xFF;
| ~~~~~^~~~~~~~~~~~~~~~~~
(and similar repeat over again). Are fallthroughs intended?
Also, it requires LUA_QS
and LUA_QL
, absent in 5.4. I've copied them from Lua 5.2 and it kinda works, but I ask in case an update or some reworking is needed. Thank you in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.