Call iterator from within iterator

2023-06-20 Thread smsifmjxtzggadeh
Yeah that's what I'm doing now. I didn't read the code in the first response carefully because I thought they were just copying from the manual that I had already poured over.

Call iterator from within iterator

2023-06-20 Thread Yardanico
You could always just do a `for elem in iter: yield elem` in your own iterator to yield from other ones.

Call iterator from within iterator

2023-06-20 Thread smsifmjxtzggadeh
I'll just use a macro. I would just prefer the editor extension to be able to check the types.

Call iterator from within iterator

2023-06-20 Thread smsifmjxtzggadeh
So a few paragraphs later when it says: > 3\. Neither inline nor closure iterators can be (directly)* recursive. That doesn't mean they're callable?

Call iterator from within iterator

2023-06-20 Thread demotomohiro
Please read this: iterators are not used like procedures. iterator m2(x: int): int = for i in 1..x: if i mod 2 == 0: yield i iterator m3(x: int): int = for i in 1..x:

Call iterator from within iterator

2023-06-20 Thread smsifmjxtzggadeh
I want to call 2 different iterators conditionally: import os type FsOrTest* = object case kind: bool of true: dir: string of false: testFiles: seq[string] iterator walk*(dir: FsOrTest): string = case dir.kind of true: dir.dir.walkDirRec

macro - issue with the identifiers

2023-06-20 Thread mantielero
That fixed it. Thanks a lot.

Building 1.6 on RHEL 7 on POWER (pp64le)?

2023-06-20 Thread rockcavera
Do the following since you have 1.6.12 on RHEL 8 server x86_64. Go to the Nim folder where the .nim compiler source code is and edit the `installer.ini` file, removing the platforms you don't want. In your case, it should just be `linux: powerpc64el`, if I'm not wrong. ; This confi

Multithread with js target

2023-06-20 Thread Zoom
This is not possible, as JavaScript runs in a single thread. Some runtimes, such as node.js, provide threading in some ways, but it's not inherent to the language so to use it you need to write bindings to specific functionality these runtimes provide.

Multithread with js target

2023-06-20 Thread Traveler
Hi, Is there a way to get the thread pool working for a js target? It seems to be ignored when compiling to js.

Building 1.6 on RHEL 7 on POWER (pp64le)?

2023-06-20 Thread cheekm
Thanks for the reply. I downloaded the 1.6.12 source and successfully built it on a RHEL 8 server on x86_64. I then ran this command: ./koch csource -d:nimEmulateOverflowChecks This was successful. I then tar-ed up the whole nim-1.6.12 dir, copied it over to my RHEL 7 on ppc64le and tried "sh

The Algorithms In Nim

2023-06-20 Thread dlesnoff
Hello! I want to share the latest progress we made on this project. With the help of ZoomRmc, we wrote a contributing.md file describing what we expect for new algorithmic contributions. We got several nice workflows from Vil02 checking the contributions on the three OSes for the latest compiler

Building 1.6 on RHEL 7 on POWER (pp64le)?

2023-06-20 Thread Araq
Well you need to compile with `-d:nimEmulateOverflowChecks`. :P The best idea is probably to use a 1.6 Nim on Linux to generate csources for 1.6 with `-d:nimEmulateOverflowChecks` and then move the csources to your RHEL 7 machine and bootstrap from these custom csources.