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

better docs: os #10492

Merged
merged 2 commits into from
Jan 30, 2019
Merged

better docs: os #10492

merged 2 commits into from
Jan 30, 2019

Conversation

narimiran
Copy link
Member

No description provided.

## # a/b/
## # a/b/c
##
## for p in g.parentDirs(inclusive=false):
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand how this shows what inclusive means. And it should have been named fullPaths?

Copy link
Member

Choose a reason for hiding this comment

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

i prefer this:

runnableExamples:
  import sequtils
  doAssert toSeq(parentDirs("a/b/c.nim", inclusive = true)) == @["a/b/c.nim", "a/b", "a"]
  • more compact
  • makes clear behavior inclusive=true is to include the original path regardless it looks like a file or not (since it's a string-only operation (as opposed to file-system), it doesn't make a difference)

lib/pure/os.nim Show resolved Hide resolved
@timotheecour
Copy link
Member

my only concern is the doc links eg

`putEnv proc <#putEnv,string,string>`_

which are ugly when browsing (or writing!) source code, are not DRY, and add tehnical debt (and risk of breakage when signature proc changes)

see nim-lang/RFCs#125 which would eliminate this issue

@Araq Araq merged commit 0c2c2dc into nim-lang:devel Jan 30, 2019
@narimiran narimiran deleted the os-docs-squashed branch February 23, 2019 06:41
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