lua-users home
lua-l archive

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

Thanks, that assignment takes care of my misunderstanding. 

-----Original Message-----

Message: 5
Date: Mon, 19 Sep 2011 17:40:10 -0400
From: <>
Subject: 5.2 require populates package.loaded with nil
To: <>
Content-Type: text/plain;	charset="utf-8"

I have a single-function module build with Visual Studio 2010 that
apparently loads but its function cannot be accessed because the entries
in package.loaded are nil.  Below print(type(cb)) returns nil while all
other k's in package.loaded return table.

Obviously, I am doing something wrong?

Here is a link to the code for the module:

C:\Documents and Settings\e0058060\My
Lua 5.2.0 (beta)  Copyright (C) 1994-2011, PUC-Rio
> require("cb")
> for k,v in pairs(package.loaded) do print(k,v) end
string  table: 003588E8
debug   table: 00358378
package table: 003569F8
_G      table: 00354E80
io      table: 00357868
os      table: 00357528
table   table: 00357578
math    table: 00359780
cb      table: 0035C9A8
coroutine       table: 003571F8
bit32   table: 003591E0
> for k,v in pairs(package.loaded.cb) do print(k,v) end
write   function: 00381390
> print(type(os))
> print(type(cb))
> print(type(string))


	Allan Pfalzgraf 

	4201 North 27 Street 
	Milwaukee, WI 53216 
	tel: 414 449-6872 
	fax: 414 449-6616 <>  <> 


Message: 6
Date: Mon, 19 Sep 2011 19:44:42 -0300
From: Luiz Henrique de Figueiredo <>
Subject: Re: 5.2 require populates package.loaded with nil
To: Lua mailing list <>
Message-ID: <>
Content-Type: text/plain; charset=us-ascii

> Below print(type(cb)) returns nil while all

luaL_newlib does not create a global named cb.
If you need this use

lua-l mailing list

End of lua-l Digest, Vol 14, Issue 74