lua-users home
lua-l archive

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

On Wed, Jan 21, 2009 at 2:51 PM, František Fuka <> wrote:
> Another possibility was to simply "require" all the modules and then iterate
> through the whole package.loaded table, finding all tables which have item
> with key "test_function" whose value is function (I know other modules don't
> contain this function). But this also doesn't work because the order is
> significant. I have to call the test_function() functions in exactly the
> same order their filenames are present in the original array.

If you do that, and call debug.getinfo() on each of the test_function
functions, you might be able to get  the source file name of

% lua
Lua 5.1.2  Copyright (C) 1994-2007, PUC-Rio
> require "foo"
> = debug.getinfo(should_be_foo.test_function).source
~/w/doc/notes/burndown % cat foo.lua

module "should_be_foo"

function test_function() end

Will that help?


Ars longa, vita brevis, occasio praeceps, experimentum periculosum,
iudicium difficile.