[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Private modules, was Calling module from a C function
- From: Tomas Guisasola Gorham <tomas@...>
- Date: Thu, 26 Apr 2007 11:47:04 -0300 (BRT)
Hi Thomas
On Thu, 26 Apr 2007, Thomas Lauer wrote:
> Tomas Guisasola Gorham <tomas@tecgraf.puc-rio.br> wrote:
> > I mean:
> >
> > == A.lua ==
> > module"A"
> > g = 10
> > function f (x) return x+g end
> >
> > == B.lua ==
> > local A = require"A"
> > module"B"
> > g = 20
> > import_f_from_A
> >
> > What will be the result of B.f(2) ?
>
> Did you try?
Surelly not. There is no `import_f_from_A'. I was just
trying to understand the semantics of this import function you
were proposing.
> > > Alas, doing this would break most existing module code.
> > Why?
>
> I can't see how the current module system would cleanly refer to more
> than one parameter, given that module()'s list of optional parameters
> (after the name) is a list of functions to be applied over the module.
Yes, code like `module(...)' will not work if required
with more than one argument (supposing `require' will pass them
to the module).
Regards,
Tomás
- References:
- Re: Private modules, was Calling module from a C function, Jim Whitehead II
- Re: Private modules, was Calling module from a C function, Roberto Ierusalimschy
- Re: Private modules, was Calling module from a C function, Thomas Lauer
- Re: Private modules, was Calling module from a C function, Tomas Guisasola Gorham
- Re: Private modules, was Calling module from a C function, Thomas Lauer
- Re: Private modules, was Calling module from a C function, Tomas Guisasola Gorham
- Re: Private modules, was Calling module from a C function, Thomas Lauer