lua-users home
lua-l archive

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


Hi Fabio Mascarenhas,

Check the !# line in the two scripts, they should be pointing to different Lua binaries, only one of which has been compiled with your extra "attach" function.
BTW, why are you adding a funcion to lua.c instead of packaging it in a C module and require'ing?

Ah! I haven't think of the first line.
Thank you! Now I understand about this.
And the reason why I didn't make expanded apis as a package is that I haven't done it and this way was only just my first try. Now I will make them as a package.

Again, Thank you, Fabio Mascarenhas

Sincerely
Journeyer Joh

----------------------------------------
Journeyer J. Joh
o o s a p r o g r a m m e r
a t
g m a i l  d o t  c o m
----------------------------------------


2013/10/29 Fabio Mascarenhas <mascarenhas@acm.org>
On Mon, Oct 28, 2013 at 9:09 AM, Journeyer J. Joh <oosaprogrammer@gmail.com> wrote:
I need to verify one thing.
The api "attach()" is defined in lua.c like below.

int my_attach(lua_State *L)
{
 ...........
}
static int pmain (lua_State *L) {
    ...................
    lua_pushcfunction(L, my_attach);
    lua_setglobal(L, "attach");
    ....................
}

#1. I'd like to know the difference between those two below.

wsapi --op

  and 

orbit ics.lua

#2. How can I make my code access extended lua api, attach() with below?

wsapi --op



Check the !# line in the two scripts, they should be pointing to different Lua binaries, only one of which has been compiled with your extra "attach" function.

BTW, why are you adding a funcion to lua.c instead of packaging it in a C module and require'ing?
 
And there is another difference between those two.

href = "" media = 'screen'

This code shows different behaviors depending on how the orbit web service is invoked.
So,

#3. Why this code behaves differently depending on how orbit is invoked?


The snippet above does not compile, so I will assume that you are talking about the return value of web:static_link. The static_link method tries to prefix the link with the application path, depending on how you launched the application and where it is this prefix will be different. You can always override the launcher's guess by setting the "prefix" field of the web object.

--
Fabio Mascarenhas