-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 Documentation #13811
Add Documentation #13811
Conversation
lib/posix/posix_utils.nim
Outdated
@@ -84,6 +84,9 @@ proc mkstemp*(prefix: string): (string, File) = | |||
## Creates a unique temporary file from a prefix string. Adds a six chars suffix. | |||
## The file is created with perms 0600. | |||
## Returns the filename and a file opened in r/w mode. | |||
runnableExamples: | |||
let (filename, fileObj) = mkstemp(prefix = "Nim") | |||
doAssert filename is string and fileObj is File |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this redundant? The proc signature already specifies the return type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tbh, lately I've been struggling with the documentation. I recall there was someone responsible for handling documentation but I can't find the correct person to contact regarding this so I've defaulted to no action...
But I'd rather have the return type be explicitly stated in the text that describe the procedure. Because there are times where I'm uncertain of what is going to be returned by the procedure. E.g. os.walkFiles, it is going to return a string
. but what is the string
going to represent? is it a full path to the file? a relative path? Today I have to create a new nim file just to try this out...
I don't mind making pull requests for proposals I find from now on, but I'm not sure if you are interested in small proposals like the ones I have in mind...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@0xACE we're interested.
runnableExamples
, only Documentation.