What does "p." stands for in the Scribunto reference manual and many modules

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

What does "p." stands for in the Scribunto reference manual and many modules

Mathieu Stumpf Guntz
Hello,

Well, it's nothing functionally important, but I was wondering what the
"p" initial was for, as it's used everywhere as the returned value by
modules. I recall I already asked that somewhere, but I can't remember
if I was a replied a significant answer, sorry.

Kind regards

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: What does "p." stands for in the Scribunto reference manual and many modules

Danny B.-2
Just a small technical note:

As long as "p" is not forced by software to be used, you are welcome to use
any kind of name for the module within the module code, though the export
for the console will still remain under "p".

We actually use "_module" instead, exactly because of lack of (common)
knowledge of what "p" stands for as well as for its overall zero
descriptiveness.


Kind regards


Danny B.

---------- Původní e-mail ----------
Od: mathieu stumpf guntz <[hidden email]>
Komu: Wikimedia developers <[hidden email]>
Datum: 29. 9. 2017 13:06:37
Předmět: [Wikitech-l] What does "p." stands for in the Scribunto reference
manual and many modules
"Hello,

Well, it's nothing functionally important, but I was wondering what the
"p" initial was for, as it's used everywhere as the returned value by
modules. I recall I already asked that somewhere, but I can't remember
if I was a replied a significant answer, sorry.

Kind regards

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l"
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: What does "p." stands for in the Scribunto reference manual and many modules

Mathieu Stumpf Guntz


Le 29/09/2017 à 13:25, Danny B. a écrit :
> Just a small technical note:
>
> As long as "p" is not forced by software to be used, you are welcome to use
> any kind of name for the module within the module code, though the export
> for the console will still remain under "p".
>
> We actually use "_module" instead, exactly because of lack of (common)
> knowledge of what "p" stands for as well as for its overall zero
> descriptiveness.
Where? In the reference manual, it's `p` which is used. Should it be
updated with `_module`?

But I'm affraid that could lead to confusion for beginners when the
console require to use `p`.
What about alliasing `p` with `_module`, and even `m` in the scribunto
console?

>
>
> Kind regards
>
>
> Danny B.
>
> ---------- Původní e-mail ----------
> Od: mathieu stumpf guntz <[hidden email]>
> Komu: Wikimedia developers <[hidden email]>
> Datum: 29. 9. 2017 13:06:37
> Předmět: [Wikitech-l] What does "p." stands for in the Scribunto reference
> manual and many modules
> "Hello,
>
> Well, it's nothing functionally important, but I was wondering what the
> "p" initial was for, as it's used everywhere as the returned value by
> modules. I recall I already asked that somewhere, but I can't remember
> if I was a replied a significant answer, sorry.
>
> Kind regards
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l"
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: What does "p." stands for in the Scribunto reference manual and many modules

Brad Jorsch (Anomie)
On Fri, Sep 29, 2017 at 7:05 AM, mathieu stumpf guntz <
[hidden email]> wrote:

> Well, it's nothing functionally important, but I was wondering what the
> "p" initial was for, as it's used everywhere as the returned value by
> modules.


"package", I believe. As noted, nothing actually requires that the variable
be named "p", that's just the convention. For that matter, nothing requires
the variable even exist. You could have a module return the method table
directly, like

return {
    hello = function () return "Hello, world!" end
}

and that would be valid. But for a long module that might get hard to read,
and wouldn't allow one method to call another if necessary.


On Fri, Sep 29, 2017 at 7:40 AM, mathieu stumpf guntz <
[hidden email]> wrote:

> Where? In the reference manual, it's `p` which is used. Should it be
> updated with `_module`?
>
> But I'm affraid that could lead to confusion for beginners when the
> console require to use `p`.
> What about alliasing `p` with `_module`, and even `m` in the scribunto
> console?


Let's not overcomplicate everything. If someone would rather use "_module"
or "m" in the console, they can always enter "_module = p" or the like
before starting their testing.


--
Brad Jorsch (Anomie)
Senior Software Engineer
Wikimedia Foundation
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: What does "p." stands for in the Scribunto reference manual and many modules

Mathieu Stumpf Guntz


Le 29/09/2017 à 16:16, Brad Jorsch (Anomie) a écrit :
> On Fri, Sep 29, 2017 at 7:05 AM, mathieu stumpf guntz <
> [hidden email]> wrote:
>
>> Well, it's nothing functionally important, but I was wondering what the
>> "p" initial was for, as it's used everywhere as the returned value by
>> modules.
>
> "package", I believe.
At least it seems relevant, thank you.

>   As noted, nothing actually requires that the variable
> be named "p", that's just the convention. For that matter, nothing requires
> the variable even exist. You could have a module return the method table
> directly, like
>
> return {
>      hello = function () return "Hello, world!" end
> }
>
> and that would be valid. But for a long module that might get hard to read,
> and wouldn't allow one method to call another if necessary.
Yes, I was aware of that, but thank you to take time to explain it
clearly again.

> On Fri, Sep 29, 2017 at 7:40 AM, mathieu stumpf guntz <
> [hidden email]> wrote:
>
>> Where? In the reference manual, it's `p` which is used. Should it be
>> updated with `_module`?
>>
>> But I'm affraid that could lead to confusion for beginners when the
>> console require to use `p`.
>> What about alliasing `p` with `_module`, and even `m` in the scribunto
>> console?
>
> Let's not overcomplicate everything. If someone would rather use "_module"
> or "m" in the console, they can always enter "_module = p" or the like
> before starting their testing.
That's right and now that I have some word to match with the initialism,
I'm fine with p.
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l