lua-users home
lua-l archive

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


From: "Thatcher Ulrich" <tu@tulrich.com>
> I took the liberty of putting together the bare bones of a Binary
> Module system for Lua 4.0, based on Ignacio's uselib code.

I went and created my very first Luamodule to have a simple one-file
example:

http://lua-users.org/wiki/LuaFuzzy
A very simple Lua extension that only defines one function 'fuzzy'.

loadmodule("fuzzy")
thetext = [[A lnger Text to saerch]]
searchstr = "longer"
print(fuzzy(thetext,searchstr))
-- gives about 54.54
-- while
print(fuzzy(thetext,"longer"))
-- gives 100, a complete match

This Lua extension was built to be used with the 'loadmodule' by Thatcher
Ulrich
http://lua-users.org/wiki/LuaBinaryModules

Main goal was to write a 'tutorial' like minimal extension that is
completely seft-sufficent, only requiring one C source file.

A Win32 Lua binary, the compiled luafuzzy.dll along with the source can be
downloaded from the Wiki.

As this is my very first real Lua-module, I don't think it's flawless ;)
Please use only as example!

Comments very welcome,

-Martin