lua-users home
lua-l archive

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


Hi,

I am trying to build lua52.dll, lua.exe and luac.exe on Windows (using MSVC).
lua.exe build is ok. 

But I got some link errors when building luac.exe.
 * luaU_dump  (exported as LUAI_FUNC not LUA_API)
 * luaP_opnames (exported as LUAI_DDEC -> extern)
 * luaP_opmodes (exported as LUAI_DDEC -> extern)

Anyone else had this problem.

Thanks.

Vinicius Jarina.

On Sun, Nov 27, 2011 at 6:43 PM, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> If anything this discussion shows that no policy lua sets will be
> satisfactory for every use case. As I've said in the past, I would rather
> see lua adopt its philosophy of allowing the programmer set the policy:
> don't set 'n', return the length in the second return.

I do not think that table.pack returning a .n field is a policy set
by Lua. In particular, no function assumes the existence of such a
field. This is just particular to table.pack.

(The old implementation of varargs used such a field and that was never
a problem.  The problem was the use of that field by remove/insert and
similar functions. That set a policy.)

Previous experience with string.gsub shows that, sometimes, it is not
such a good idea for a function to return two values; it often leads
to confusion when people forget about the second return. The message
that started this discussion hints that table.pack with two returns
would be in the same category of string.gsub.

-- Roberto