{"action":"created","comment":{"url":"https://api.github.com/repos/nim-lang/Nim/pulls/comments/200809734","pull_request_review_id":135201504,"id":200809734,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDgwOTczNA==","diff_hunk":"@@ -296,6 +296,31 @@ proc setCurrentDir*(newDir: string) {.inline, tags: [].} =\n   else:\n     if chdir(newDir) != 0'i32: raiseOSError(osLastError())\n \n+proc absolutePath*(path: string, root = getCurrentDir()): string =\n+  ## Returns the absolute path of `path`, rooted at `root` (which must be absolute)\n+  ## if `path` is absolute, return it, ignoring `root`\n+  runnableExamples:\n+    doAssert absolutePath(\"a\") == getCurrentDir() / \"a\"\n+  if isAbsolute(path): path\n+  else:\n+    doAssert root.isAbsolute, root\n+    joinPath(root, path)\n+\n+when isMainModule:\n+  # TODO: use doAssertRaises pending https://github.com/nim-lang/Nim/issues/8223\n+  try:\n+    let a = absolutePath(\"a\", \"b\")\n+    doAssert false, \"should've thrown\"\n+  except:","path":"lib/pure/os.nim","position":19,"original_position":19,"commit_id":"d8afc589773674011f95af3ebaa90f5a3cd31851","original_commit_id":"d8afc589773674011f95af3ebaa90f5a3cd31851","user":{"login":"timotheecour","id":2194784,"node_id":"MDQ6VXNlcjIxOTQ3ODQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2194784?v=4","gravatar_id":"","url":"https://api.github.com/users/timotheecour","html_url":"https://github.com/timotheecour","followers_url":"https://api.github.com/users/timotheecour/followers","following_url":"https://api.github.com/users/timotheecour/following{/other_user}","gists_url":"https://api.github.com/users/timotheecour/gists{/gist_id}","starred_url":"https://api.github.com/users/timotheecour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timotheecour/subscriptions","organizations_url":"https://api.github.com/users/timotheecour/orgs","repos_url":"https://api.github.com/users/timotheecour/repos","events_url":"https://api.github.com/users/timotheecour/events{/privacy}","received_events_url":"https://api.github.com/users/timotheecour/received_events","type":"User","site_admin":false},"body":"actually that try/catch was buggy independently of the fact that assertion failures are not catchable; will fix; thanks!","created_at":"2018-07-07T11:15:31Z","updated_at":"2018-07-07T11:15:31Z","html_url":"https://github.com/nim-lang/Nim/pull/8213#discussion_r200809734","pull_request_url":"https://api.github.com/repos/nim-lang/Nim/pulls/8213","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/nim-lang/Nim/pulls/comments/200809734"},"html":{"href":"https://github.com/nim-lang/Nim/pull/8213#discussion_r200809734"},"pull_request":{"href":"https://api.github.com/repos/nim-lang/Nim/pulls/8213"}},"in_reply_to_id":200807281},"pull_request":{"url":"https://api.github.com/repos/nim-lang/Nim/pulls/8213","id":199566620,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NTY2NjIw","html_url":"https://github.com/nim-lang/Nim/pull/8213","diff_url":"https://github.com/nim-lang/Nim/pull/8213.diff","patch_url":"https://github.com/nim-lang/Nim/pull/8213.patch","issue_url":"https://api.github.com/repos/nim-lang/Nim/issues/8213","number":8213,"state":"open","locked":false,"title":"add os.absolutePath; fixes #8174","user":{"login":"timotheecour","id":2194784,"node_id":"MDQ6VXNlcjIxOTQ3ODQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2194784?v=4","gravatar_id":"","url":"https://api.github.com/users/timotheecour","html_url":"https://github.com/timotheecour","followers_url":"https://api.github.com/users/timotheecour/followers","following_url":"https://api.github.com/users/timotheecour/following{/other_user}","gists_url":"https://api.github.com/users/timotheecour/gists{/gist_id}","starred_url":"https://api.github.com/users/timotheecour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timotheecour/subscriptions","organizations_url":"https://api.github.com/users/timotheecour/orgs","repos_url":"https://api.github.com/users/timotheecour/repos","events_url":"https://api.github.com/users/timotheecour/events{/privacy}","received_events_url":"https://api.github.com/users/timotheecour/received_events","type":"User","site_admin":false},"body":"fixes https://github.com/nim-lang/Nim/issues/8174\r\n\r\nNOTE: see https://github.com/nim-lang/Nim/issues/8174 and  https://forum.nim-lang.org/t/4004 for prior discussion.\r\n`absolutePath` would be best put in `ospaths` but nim doesn't support circular dependencies (yet...).\r\n\r\nAn alternative would've been to split in 2:\r\n```\r\n# in ospaths:\r\nproc absolutePath*(path: string, base: string)\r\n# in os:\r\nproc absolutePath*(path: string)\r\n```\r\nbut that's uglier (and less DRY).\r\n\r\nAnother alternative would've been to add fwd reference of `getCurrentDir` in ospaths but that causes link errors in case user doesn't explicitly call `getCurrentDir`but just calls `absolutePath` in his code  (something nim could improve on IMO )\r\n\r\n","created_at":"2018-07-05T19:33:13Z","updated_at":"2018-07-07T11:15:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d680277aaa31c032cf9b32aa9a55b685a57af06f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/nim-lang/Nim/pulls/8213/commits","review_comments_url":"https://api.github.com/repos/nim-lang/Nim/pulls/8213/comments","review_comment_url":"https://api.github.com/repos/nim-lang/Nim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nim-lang/Nim/issues/8213/comments","statuses_url":"https://api.github.com/repos/nim-lang/Nim/statuses/d8afc589773674011f95af3ebaa90f5a3cd31851","head":{"label":"timotheecour:pr_abspath","ref":"pr_abspath","sha":"d8afc589773674011f95af3ebaa90f5a3cd31851","user":{"login":"timotheecour","id":2194784,"node_id":"MDQ6VXNlcjIxOTQ3ODQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2194784?v=4","gravatar_id":"","url":"https://api.github.com/users/timotheecour","html_url":"https://github.com/timotheecour","followers_url":"https://api.github.com/users/timotheecour/followers","following_url":"https://api.github.com/users/timotheecour/following{/other_user}","gists_url":"https://api.github.com/users/timotheecour/gists{/gist_id}","starred_url":"https://api.github.com/users/timotheecour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timotheecour/subscriptions","organizations_url":"https://api.github.com/users/timotheecour/orgs","repos_url":"https://api.github.com/users/timotheecour/repos","events_url":"https://api.github.com/users/timotheecour/events{/privacy}","received_events_url":"https://api.github.com/users/timotheecour/received_events","type":"User","site_admin":false},"repo":{"id":126543719,"node_id":"MDEwOlJlcG9zaXRvcnkxMjY1NDM3MTk=","name":"Nim","full_name":"timotheecour/Nim","owner":{"login":"timotheecour","id":2194784,"node_id":"MDQ6VXNlcjIxOTQ3ODQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2194784?v=4","gravatar_id":"","url":"https://api.github.com/users/timotheecour","html_url":"https://github.com/timotheecour","followers_url":"https://api.github.com/users/timotheecour/followers","following_url":"https://api.github.com/users/timotheecour/following{/other_user}","gists_url":"https://api.github.com/users/timotheecour/gists{/gist_id}","starred_url":"https://api.github.com/users/timotheecour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timotheecour/subscriptions","organizations_url":"https://api.github.com/users/timotheecour/orgs","repos_url":"https://api.github.com/users/timotheecour/repos","events_url":"https://api.github.com/users/timotheecour/events{/privacy}","received_events_url":"https://api.github.com/users/timotheecour/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/timotheecour/Nim","description":"Nim is a compiled, garbage-collected systems programming language with a design that focuses on efficiency, expressiveness, and elegance (in that order of priority).","fork":true,"url":"https://api.github.com/repos/timotheecour/Nim","forks_url":"https://api.github.com/repos/timotheecour/Nim/forks","keys_url":"https://api.github.com/repos/timotheecour/Nim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/timotheecour/Nim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/timotheecour/Nim/teams","hooks_url":"https://api.github.com/repos/timotheecour/Nim/hooks","issue_events_url":"https://api.github.com/repos/timotheecour/Nim/issues/events{/number}","events_url":"https://api.github.com/repos/timotheecour/Nim/events","assignees_url":"https://api.github.com/repos/timotheecour/Nim/assignees{/user}","branches_url":"https://api.github.com/repos/timotheecour/Nim/branches{/branch}","tags_url":"https://api.github.com/repos/timotheecour/Nim/tags","blobs_url":"https://api.github.com/repos/timotheecour/Nim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/timotheecour/Nim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/timotheecour/Nim/git/refs{/sha}","trees_url":"https://api.github.com/repos/timotheecour/Nim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/timotheecour/Nim/statuses/{sha}","languages_url":"https://api.github.com/repos/timotheecour/Nim/languages","stargazers_url":"https://api.github.com/repos/timotheecour/Nim/stargazers","contributors_url":"https://api.github.com/repos/timotheecour/Nim/contributors","subscribers_url":"https://api.github.com/repos/timotheecour/Nim/subscribers","subscription_url":"https://api.github.com/repos/timotheecour/Nim/subscription","commits_url":"https://api.github.com/repos/timotheecour/Nim/commits{/sha}","git_commits_url":"https://api.github.com/repos/timotheecour/Nim/git/commits{/sha}","comments_url":"https://api.github.com/repos/timotheecour/Nim/comments{/number}","issue_comment_url":"https://api.github.com/repos/timotheecour/Nim/issues/comments{/number}","contents_url":"https://api.github.com/repos/timotheecour/Nim/contents/{+path}","compare_url":"https://api.github.com/repos/timotheecour/Nim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/timotheecour/Nim/merges","archive_url":"https://api.github.com/repos/timotheecour/Nim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/timotheecour/Nim/downloads","issues_url":"https://api.github.com/repos/timotheecour/Nim/issues{/number}","pulls_url":"https://api.github.com/repos/timotheecour/Nim/pulls{/number}","milestones_url":"https://api.github.com/repos/timotheecour/Nim/milestones{/number}","notifications_url":"https://api.github.com/repos/timotheecour/Nim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/timotheecour/Nim/labels{/name}","releases_url":"https://api.github.com/repos/timotheecour/Nim/releases{/id}","deployments_url":"https://api.github.com/repos/timotheecour/Nim/deployments","created_at":"2018-03-23T22:12:47Z","updated_at":"2018-03-23T22:12:54Z","pushed_at":"2018-07-07T09:47:31Z","git_url":"git://github.com/timotheecour/Nim.git","ssh_url":"git@github.com:timotheecour/Nim.git","clone_url":"https://github.com/timotheecour/Nim.git","svn_url":"https://github.com/timotheecour/Nim","homepage":"http://nim-lang.org/","size":70406,"stargazers_count":0,"watchers_count":0,"language":"Nim","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"nim-lang:devel","ref":"devel","sha":"a1457bfa9ffad3e59b49380fce70d29720485e7d","user":{"login":"nim-lang","id":603863,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwMzg2Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/603863?v=4","gravatar_id":"","url":"https://api.github.com/users/nim-lang","html_url":"https://github.com/nim-lang","followers_url":"https://api.github.com/users/nim-lang/followers","following_url":"https://api.github.com/users/nim-lang/following{/other_user}","gists_url":"https://api.github.com/users/nim-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/nim-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nim-lang/subscriptions","organizations_url":"https://api.github.com/users/nim-lang/orgs","repos_url":"https://api.github.com/users/nim-lang/repos","events_url":"https://api.github.com/users/nim-lang/events{/privacy}","received_events_url":"https://api.github.com/users/nim-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":842037,"node_id":"MDEwOlJlcG9zaXRvcnk4NDIwMzc=","name":"Nim","full_name":"nim-lang/Nim","owner":{"login":"nim-lang","id":603863,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwMzg2Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/603863?v=4","gravatar_id":"","url":"https://api.github.com/users/nim-lang","html_url":"https://github.com/nim-lang","followers_url":"https://api.github.com/users/nim-lang/followers","following_url":"https://api.github.com/users/nim-lang/following{/other_user}","gists_url":"https://api.github.com/users/nim-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/nim-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nim-lang/subscriptions","organizations_url":"https://api.github.com/users/nim-lang/orgs","repos_url":"https://api.github.com/users/nim-lang/repos","events_url":"https://api.github.com/users/nim-lang/events{/privacy}","received_events_url":"https://api.github.com/users/nim-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nim-lang/Nim","description":"Nim is a compiled, garbage-collected systems programming language with a design that focuses on efficiency, expressiveness, and elegance (in that order of priority).","fork":false,"url":"https://api.github.com/repos/nim-lang/Nim","forks_url":"https://api.github.com/repos/nim-lang/Nim/forks","keys_url":"https://api.github.com/repos/nim-lang/Nim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nim-lang/Nim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nim-lang/Nim/teams","hooks_url":"https://api.github.com/repos/nim-lang/Nim/hooks","issue_events_url":"https://api.github.com/repos/nim-lang/Nim/issues/events{/number}","events_url":"https://api.github.com/repos/nim-lang/Nim/events","assignees_url":"https://api.github.com/repos/nim-lang/Nim/assignees{/user}","branches_url":"https://api.github.com/repos/nim-lang/Nim/branches{/branch}","tags_url":"https://api.github.com/repos/nim-lang/Nim/tags","blobs_url":"https://api.github.com/repos/nim-lang/Nim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nim-lang/Nim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nim-lang/Nim/git/refs{/sha}","trees_url":"https://api.github.com/repos/nim-lang/Nim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nim-lang/Nim/statuses/{sha}","languages_url":"https://api.github.com/repos/nim-lang/Nim/languages","stargazers_url":"https://api.github.com/repos/nim-lang/Nim/stargazers","contributors_url":"https://api.github.com/repos/nim-lang/Nim/contributors","subscribers_url":"https://api.github.com/repos/nim-lang/Nim/subscribers","subscription_url":"https://api.github.com/repos/nim-lang/Nim/subscription","commits_url":"https://api.github.com/repos/nim-lang/Nim/commits{/sha}","git_commits_url":"https://api.github.com/repos/nim-lang/Nim/git/commits{/sha}","comments_url":"https://api.github.com/repos/nim-lang/Nim/comments{/number}","issue_comment_url":"https://api.github.com/repos/nim-lang/Nim/issues/comments{/number}","contents_url":"https://api.github.com/repos/nim-lang/Nim/contents/{+path}","compare_url":"https://api.github.com/repos/nim-lang/Nim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nim-lang/Nim/merges","archive_url":"https://api.github.com/repos/nim-lang/Nim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nim-lang/Nim/downloads","issues_url":"https://api.github.com/repos/nim-lang/Nim/issues{/number}","pulls_url":"https://api.github.com/repos/nim-lang/Nim/pulls{/number}","milestones_url":"https://api.github.com/repos/nim-lang/Nim/milestones{/number}","notifications_url":"https://api.github.com/repos/nim-lang/Nim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nim-lang/Nim/labels{/name}","releases_url":"https://api.github.com/repos/nim-lang/Nim/releases{/id}","deployments_url":"https://api.github.com/repos/nim-lang/Nim/deployments","created_at":"2010-08-16T20:38:58Z","updated_at":"2018-07-07T09:43:55Z","pushed_at":"2018-07-07T09:12:08Z","git_url":"git://github.com/nim-lang/Nim.git","ssh_url":"git@github.com:nim-lang/Nim.git","clone_url":"https://github.com/nim-lang/Nim.git","svn_url":"https://github.com/nim-lang/Nim","homepage":"https://nim-lang.org/","size":69216,"stargazers_count":5146,"watchers_count":5146,"language":"Nim","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":674,"mirror_url":null,"archived":false,"open_issues_count":1435,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":674,"open_issues":1435,"watchers":5146,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/nim-lang/Nim/pulls/8213"},"html":{"href":"https://github.com/nim-lang/Nim/pull/8213"},"issue":{"href":"https://api.github.com/repos/nim-lang/Nim/issues/8213"},"comments":{"href":"https://api.github.com/repos/nim-lang/Nim/issues/8213/comments"},"review_comments":{"href":"https://api.github.com/repos/nim-lang/Nim/pulls/8213/comments"},"review_comment":{"href":"https://api.github.com/repos/nim-lang/Nim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nim-lang/Nim/pulls/8213/commits"},"statuses":{"href":"https://api.github.com/repos/nim-lang/Nim/statuses/d8afc589773674011f95af3ebaa90f5a3cd31851"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"timotheecour"}}