[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: LuaSocket and require
- From: David Given <dg@...>
- Date: Tue, 30 Nov 2004 12:29:31 +0000
I'm getting LuaSocket working on my system, and have run across some problems
due to the way it uses require.
Normally, Lua plugins work by you doing 'require "pluginname"', and it creates
a table in the current environment called "pluginname" containing the
LuaSocket overrides require with its own version that merely returns the
table. It doesn't install it in the environment. It seems to want you to do
'pluginname = require "pluginname"' instead.
Naturally, these two version of require are completely incompatible! I'm faced
with the choice of either (a) rewriting all third-party Lua code to use
LuaSocket's new version of require, or (b) rewriting LuaSocket to use the
more conventional version of require. I don't really want to do either,
because the more I touch third-party code, the more effort I'm going to have
to put in to upgrade it.
Has anyone else had to tackle this? If so, what did you do? Is there a
standard for this kind of thing?
+- David Given --McQ-+ "Gaping from its single obling socket was
| firstname.lastname@example.org | scintillating, many fauceted scarlet emerald..."
| (email@example.com) | --- Jim Theis, _The Eye of Argon_ (spelling
+- www.cowlark.com --+ original)