Nim 1.6.6 release candidate

2022-04-15 Thread exelotl
Seems to be working fine for me!

xml-rpc client lib?

2022-04-15 Thread naveedhd
I was searching for the same a while ago but couldn't find any. But implementing on top of `std/xmltree, xmlparser` with `net`/`httpclient` seemed doable with my limited experience with both Nim and XMLRPC. Here is some scribbles: (in the context of ROS clien

Confusion about proc forward declarations

2022-04-15 Thread jwatson-CO-edu
Ah, I see now that the supposed "working example" was a red herring. When I comment out the `meaning` forward declaration, then the compiler complains about `test_proc`. I had assumed that the declarations would be checked in the order they were written and also that they would both be checked.

Concurrent File Download with Async

2022-04-15 Thread Zoom
First of all, threads != async and your code won't be executed in threads (just in case, as you're using `threads` here as an argument). Secondly, you don't need to copy `urls`. Just make a counter `x = urls.len` for remaining URLs, `let currentUrl = urls[x - 1]` and decrease `x` until 0.

Confusion about proc forward declarations

2022-04-15 Thread treeform
> These functions are neither actually defined nor used in the file; I have > commented out their usage. It is an error to have "forward declaration" but no "later declaration". I think that is your error. Yes, you can forward declare non generic function.

Confusion about proc forward declarations

2022-04-15 Thread jwatson-CO-edu
The following `proc` forward declaration example compiles: (Taken from ) proc test_proc[T, U](arg1: T, arg2: U): float # All good! Run The following does not: proc meaning[T]( s_expr: T ): Atom # Error: implem

Concurrent File Download with Async

2022-04-15 Thread huantian
Cool, seems to work. This is the code that I've come up with. proc downloadLevels(urls: seq[Uri], folder: string, threads: int = 8): Future[void] = ## Concurrently downloads multiple urls into given folder. ## `threads` is the maximum concurrency of the download. va

xml-rpc client lib?

2022-04-15 Thread jwatson-CO-edu
I see, I think `std/`{`asynchttpserver`, `httpclient`, `xmlparser`} will be my starting place(s) as well. If I produce anything substantive, I will link to it in this thread.

Concurrent File Download with Async

2022-04-15 Thread PMunch
This is fairly simple to do, first create a list of all the files you want to download. Then spin up N async tasks to fetch the files, then simply attach a callback to each which will pop an element from the queue and fetch that (again with the same callback). Then when it fetches the last eleme

xml-rpc client lib?

2022-04-15 Thread stedi
I've not yet started. Since I don't need a server, my plan was to just use `httpclient` and `xmlparser` from the nim std lib.

Map complex C++ types into Nim

2022-04-15 Thread sls1005
I learned it by reading the generated C code.

Map complex C++ types into Nim

2022-04-15 Thread jmgomez
Yes, that did work!! Thanks! Is that on the docs? Couldnt find it

Do name the array element

2022-04-15 Thread xigoi
Alternatively, you may use a tuple or object. var a: tuple[left: int, middle: int, right: int] a.left = 7 a.middle = 8 a.right = 9 Run