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
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 psychoslave@culture-libre.org Komu: Wikimedia developers wikitech-l@lists.wikimedia.org 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 Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l"
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 psychoslave@culture-libre.org Komu: Wikimedia developers wikitech-l@lists.wikimedia.org 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 Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l" _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Fri, Sep 29, 2017 at 7:05 AM, mathieu stumpf guntz < psychoslave@culture-libre.org> 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 < psychoslave@culture-libre.org> 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.
Le 29/09/2017 à 16:16, Brad Jorsch (Anomie) a écrit :
On Fri, Sep 29, 2017 at 7:05 AM, mathieu stumpf guntz < psychoslave@culture-libre.org> 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 < psychoslave@culture-libre.org> 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@lists.wikimedia.org