Small inaccuracy in manual

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Small inaccuracy in manual

Dirk Laurie-2
The manual says under 'package.loaded':

    When you require a module modname and package.loaded[modname] is
not false, require simply returns the value stored there.

This formulation is precise and correct.

Under 'require', it says:

   The function starts by looking into the package.loaded table to
determine whether modname is already loaded.

This formulation is less precise but not incorrect.

And under luaL_requiref:

    "If modname is not already present in package.loaded, calls
function openf .."

This formulation is wrong. If modname is present but false, openf is not called.

Reply | Threaded
Open this post in threaded view
|

Re: Small inaccuracy in manual

Dirk Laurie-2
2018-02-24 18:02 GMT+02:00 Dirk Laurie <[hidden email]>:

> The manual says under 'package.loaded':
>
>     When you require a module modname and package.loaded[modname] is
> not false, require simply returns the value stored there.
>
> This formulation is precise and correct.
>
> Under 'require', it says:
>
>    The function starts by looking into the package.loaded table to
> determine whether modname is already loaded.
>
> This formulation is less precise but not incorrect.
>
> And under luaL_requiref:
>
>     "If modname is not already present in package.loaded, calls
> function openf .."
>
> This formulation is wrong. If modname is present but false, openf is not called.

Oops, I mean "is also called", not "is not called".