Philippe Lhoste

lua-users home
wiki

Philippe Lhoste data.

Long time Lua admirer and Lua mailing list lurker, with occasional interventions... Well, not so occasional, a Web interface to the mailing list seems to show I am (was... start of 2003) in the top ten contributors of the list... Currently (2006), much less active, lot of discussion is well over my head, and I have other interests (but still like Lua a lot!).

How I use Lua?

Beyond the first test program à la Hello World!, I use it for small utilities, like converting Windows' high Ascii (Ansi) to Mac characters or HTML entities (see below). I don't use much advanced Lua features like co-routines or metatables (except for experimenting with classes).

I made in C a Lua interface to a DLL provided by a client to test the API it provided (an address book). It was a great improvement over the hard-coded C test program I made before, since I could easily and quickly (no compilation) change test programs, verify bugs are gone, etc. I will write something about it someday, as it was a quite learning experience and I had some ideas I would share.

I started also a Lua Win32 library. A big work (to be done), probably always in progress.

I wrote in Lua a set of scripts to manipulate postal addresses in tab separated fields (Excel or Access export). These scripts can separate first name from last name, normalize first name (capitalization, add missing French accents), separate number from way name, normalize way name for the target town, etc. Also format these data to make routing labels (printed on fast dot printer accepting only fixed-width non-graphical Dos Ascii data...). This is the most comprehensive work I did with Lua, with very nice uses of its features like the capability to put functions in data arrays.

I have done a little [Lua page], where I give MSVC++6 projects to compile Lua, and Windows binaries of Lua 4.0 (made prior to the official ones). I made also them for Lua 5.0. And a small distribution: Lua.exe, LuaC.exe and the manual with index, suitable to test and run small utilities. Files can be downloaded at [my French site]

Code samples

I plan to improve this page with code snippets, etc. Currently, code snippets can be found here, at the PhiLhoSoftLuaSamples page (badly outdated!).

I have uploaded a number of my little Lua utility programs on the Wiki. Here are most of them:

Character encoding and decoding

File massaging

Quines

Programs whose output is the source of the program itself...

Dump Object

Back to serious Lua programming, after a big gap... (2006/07/13)

This program returns a textual representation of "any" Lua object, including tables (and nested tables). Functions are not decompiled (of course). It sticks strictly to the real table constructor syntax, so the result can be reparsed by Lua to recreate the object, at least if there are NO complex objects (functions, userdata...). It handles references correctly, except for cycles (a ref. b which ref. a).

Edit (2006/11/07): I exclude keywords (v.5.1) from "naked" string keys. I saw that I could dump functions with string.dump, but I should encode (eg. in Base64) the result to Ascii to be clean, and anyway when loading the result, the functions should be decoded back. Edit (2007/03/15): Special, compact handling of empty tables. Also corrected a bug in quotes around tostring result ("foo').

Miscellaneous

Misc./Personal Sandbox

Old signature...

--=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
Programmeur professionnel et artiste amateur
http://Phi.Lho.free.fr
--=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=--

I can link to an external image! And now, from within the Wiki itself! (self portrait, with bozo colors...)


I moved this here from the LearningLua page

Introduction to some Lua concepts

Since newbies are unlikely to be playing with version 5.0, and the syntax of version 5.0 is not finalised, I dont think its a very good idea to put the new for syntax here. Any learning material should really be related to the current stable/release version. --NDT

RecentChanges · preferences
edit · history
Last edited February 22, 2008 11:29 am GMT (diff)