lua-users home
lua-l archive

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


On 02/28/11 00:12, Reuben Thomas wrote:
[...]
> OK, I bite. I use Lua regularly, and almost exclusively for
> command-line programming, and I've never needed to "argify" a string
> (nice word, though). What's it for?

I'm implementing a REPL for a game server; a simple Lua client which
prompts the user for a command, parses it, and sends it off to the
server. As such I need to be able to read a unix-style command line and
parse it into records the server will understand.

	Rename 405 "This is the new name for object #405"

...becomes {"Rename", "405", "This is the new name for object #405"} in
the wire protocol.

(FWIW, I'm using ZMQ for the wire protocol, so the above becomes a
multipart message with three records. ZMQ is great at this stuff.
Unfortunately, the version in Debian is achingly old, and it took me a
while to figure out why the ZMQ Lua bindings wouldn't compile...)

Anyway, thanks for the implementations --- much appreciated!

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "Thou who might be our Father, who perhaps may be in Heaven, hallowed
│ be Thy Name, if Name Thou hast and any desire to see it hallowed..."
│ --- _Creatures of Light and Darkness_, Roger Zelazny

Attachment: signature.asc
Description: OpenPGP digital signature