Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add field docstrings to public fields of stdlib entities #2588

Merged
merged 3 commits into from
Mar 29, 2018

Conversation

mfelsche
Copy link
Contributor

@mfelsche mfelsche commented Mar 8, 2018

where it is possible and makes sense.

With the merge of #2543 this is now syntactically valid.

Please feel free to give better suggestions for any docstring you think is wrong, inappropriate or incomplete.

@mfelsche mfelsche added enhancement: 4 - in progress do not merge This PR should not be merged at this time labels Mar 8, 2018
@mfelsche mfelsche removed do not merge This PR should not be merged at this time enhancement: 4 - in progress labels Mar 9, 2018
"""
The root capability.

Can be `None` for artificially constructed `Env`instances.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a space before "instances".

512)
```

**Note:** For reading user input from a terminal, use the `readline` package.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe most of this docstring would be more appropriate moved to the file where the Stdin actor is defined?

@@ -22,6 +22,10 @@ class Directory
Capsicum.
"""
let path: FilePath
"""
The filesystem path pointing to this directory.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should emphasize here that the FilePath type is an object capability that grants access to do stuff in this directory - it's more than just a string with a path.

@@ -80,7 +80,15 @@ class File
Operations on a file.
"""
let path: FilePath
"""
The filesystem path to this file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.

let writeable: Bool
"""
`true` if this file is writable.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one seems to not be conveying any useful information beyond that which is contained in the line above it.

Maybe it's better to say something like "the underlying file descriptor was opened as writable?

Also, should we consider fixing the misspelling of this field name now that it's been noticed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a look around and it seems, both variants are in use, writable and writeable, although writable seems to be more common. (I am not a native english speaker, so correct me if i'm wrong).

I am a bit hesitant to introduce a breaking change like this into this PR that should only be about adding documentation.

@@ -15,21 +9,79 @@ class val FileInfo
let filepath: FilePath

let mode: FileMode val = recover FileMode end
"""UNIX-style file mode"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this more consistent with some of the other field docstrings and add punctuation at the end?

let hard_links: U32 = 0
"""number of hardlinks to this `filepath`"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we capitalize this one and add punctuation at the end?

@@ -7,6 +7,7 @@ type JsonType is (F64 | I64 | Bool | None | String | JsonArray | JsonObject)

class JsonArray
var data: Array[JsonType]
"""the actual array containing JSON structures"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we capitalize this and add punctuation at the end?

@@ -73,6 +74,10 @@ class JsonArray

class JsonObject
var data: Map[String, JsonType]
"""
the actual JSON object structure,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we capitalize the start of this sentence?

let addr4: U32 = 0
"""
bits 97-128 of the IPv6 address in network byte order.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we capitalize the start of this sentence?

Same comment goes for addr1-addr3 above.

@Praetonus Praetonus merged commit 922c028 into master Mar 29, 2018
@jemc jemc deleted the field-docstring branch March 31, 2018 14:32
dipinhora pushed a commit to dipinhora/ponyc that referenced this pull request Jun 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants