-
-
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
getCurrentDir should be in ospaths, not os #9523
Comments
|
Just make sure to always import both, |
@krux02 do you mind re-opening this? There was not enough time for feedback. ospaths is meant for pure path manipulation, but for pragmatic reasons including currentDir (and as is already the case, environment variable access) makes sense so that these argulably path manipulation procs can also be included there:
and btw I'm happy to write the PR myself once this is accepted, and expect it'll lead to zero breakage |
If you want to discuss this, discuss it in the chat. The issue tracker is not for discussions. But if you really really want this to be open, I make you an offer. You alone have 200 open issues in Nim right now. They can't be all that important, if you look through them and remove three of the most unimportant ones, then I can reopen this issue. |
Come on.... That's just ... weird politics. |
not everyone follows chat at all times, and not everyone is on same timezone; chat is great (and more efficient) when you want to discuss something with specific person(s) that is logged in, or when you want help, not so much when you're discussing something that other people may care about; otherwise it leads to "behind closed doors" decisions (yes, irc/gitter is searchable but anything older than 1 day is hard to search unless you know when something was discussed); at least forum is better than IRC for that. |
It's time we merge ospaths back into os. |
@Araq @dom96 back in the days, 178275f split ospaths from os with commit msg: independently of that, I prefer keeping ospaths separate from os (and already sent out a PR for addressing this issue), it just seems cleaner to separate out path manipulation procs (+ getCurrentDir for pragmatism) from rest of os for sake of modularity |
That only some procs in
But "+ getCurrentDir for pragmatism" means the split doesn't work well. Anyhow, ospaths is not just OS independent string processing anymore, so it's all messy, having a single |
well the proper fix here would be to allow cyclic dependencies (with care taken so that a single |
That's not the "proper fix" that's a terrible design. And symbol clashes are a thing for |
this should be discussed in a separate place dedicated for
I regret raising that point; yes, these work for symbol clashes. But my point about modularization still stands;
I don't mind Nim doing things differently from every other language when there's an advantage to it, but this isn't the case here. I don't see any cons to the PR I sent out. |
On the contrary, moving existing stuff around pointlessly has no advantage. |
/cc @demotomohiro @Araq @dom96
a number of procs are in os instead of ospaths just because getCurrentDir is defined in os instead of ospaths, eg:
proc absolutePath*(path: string, root = getCurrentDir())
(because of getCurrentDir)relativePath
with 1 param as found in lots of languages (D, python, boost), as it would then forcerelativePath
to be in os instead of ospaths (see Add relativePath proc and test #8166 (comment) for that point)Furthermore, we already use getEnv to access environment variables in ospaths, so using the low-level c procs getcwd/getCurrentDirectoryW wouldn't be an issue IMO
proposal
move getCurrentDir, absolutePath, normalizedPath to ospaths
this would have zero impact on existing code
The text was updated successfully, but these errors were encountered: