Skip to content

Conversation

@ThomasTJdev
Copy link
Contributor

  1. Use assert in code sample.
  2. Updated wrong runnableExample in combine().

@narimiran narimiran self-assigned this Jan 27, 2019
lib/pure/uri.nim Outdated
## * `/ proc <#/,Uri,string>`_ for building URIs
runnableExamples:
let foo = combine(parseUri("https://nim-lang.org/blog.html"), parseUri("/install.html"))
let foo = combine([parseUri("https://nim-lang.org/blog.html"), parseUri("/install.html")])
Copy link
Member

@narimiran narimiran Jan 27, 2019

Choose a reason for hiding this comment

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

I agree that the previous example was not showcasing the correct combine proc.

But if you want to show the behaviour of varargs, maybe something like this would be better:

let foo = combine(parseUri("https://"), parseUri("nim-lang.org/"), parseUri("install.html"))
#  or with even more args:
let foo = combine(parseUri("https://"), parseUri("nim-lang.org/"), parseUri("subdir/"), parseUri("about.html"))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are totally right. Updated it with

let foo = combine(parseUri("https://nim-lang.org/"), parseUri("docs/"), parseUri("manual.html"))

@narimiran narimiran merged commit 91b39f2 into nim-lang:devel Jan 27, 2019
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.

2 participants