boot.janet docstring improvements#1764
Conversation
Janet for Mortals chapter 8 discusses this behavior for some built-in functions.
|
Regarding the text:
Please note that on the same linked page, the disclaimer from the author:
Also please note that the author of the text says:
via: https://janet.guide/ On a side note, the term "dictionary" is used on at least one page in the website docs to refer to both tables and structs. There is also a function named It is true that the existing docstrings for |
5de69ee to
54feba2
Compare
Ah I did miss that note, good catch, thanks.
I should mention I'm a bit fan of the book - the author did a fantastic job (despite their claims that nothing there should be considered "educational" xD)
Thanks for the link, interesting. It would seem best to confirm whether or not that's intended behavior for those symbols before changing their documentation.
This is also something I was looking into - but figured I'd start small and leave it for future discussion. In general (personal opinion) I find these qualities really help when using reference documentation:
Another thing on indicative mood:
|
|
Other here, I prefer imperative mood as the docs can then be used in place of the calls or function signatures. |
|
I can appreciate wanting consistency for certain aspects of the docstrings, but practically speaking I'm not sure how well that can be made to hold up over time. FWIW, my sense regarding what seems to have been valued for docstrings in janet itself include (not necessarily in this order):
This is just what comes to mind when I think back over the PRs I've seen. Ultimately it's not my call though :) |
|
I am ambivalent to stylistic changes like tense here, but the point about structs is correct. Older versions of Janet did not have polymorphic structs, but they were later extended to behave more like tables. |
May be this PR should be just about the structs bit then? |
|
Just pushed commits reverting the tense / mood. Better to rebase it out of the history instead of revert? Let me know. That leaves only the change to docstrings for polymorphic compare (isn't currently mentioned for tables or structs). |
|
I don't know how others feel about using the term "dictionary" to cover "table or struct", but FWIW some points in favor:
Against might be:
Would like to hear what folks think. [1] |
|
Some variants to propose: The "dictionary data structure (table or struct)" / "dict-ds" version is a bit more verbose, but does have two advantages:
For "indexed" - "a dictionary" reads well but "an indexed" not as cleanly - at least to me, though it's probably something one could get used to after reading enough docstrings with that format. (though "idx" as the variable name often means the "index" integer) Anyway - just some random thoughts for y'all to ponder. |
Hi! First contribution to Janet. It has been a very nice language to use.
Please let me know if you have any thoughts on these proposed changes or if changes like this are welcome / unwelcome.
For third person indicative mood...
This style is used by both Ruby and Lua and to me reads clearer:
For polymorphic compare...
Janet for Mortals chapter 8 discusses this behavior for some built-in functions.
https://janet.guide/tables-and-polymorphism/
Later in that chapter...
However, tested working for structs:
Thanks!