Re: echo without new line or async write

2018-08-07 Thread Renesac
You are right. Duh. I forgot the implications of the second part of my answer in the first one... I still prefer the 0 ..< iterations as we usually iterate from zero with non-inclusive upper bound in nim. If he changes the code at some point to use that counter, my range will probably already

Re: echo without new line or async write

2018-08-07 Thread mratsim
@miran: You sound like a Fortran spy ;)

Re: echo without new line or async write

2018-08-06 Thread miran
> you made a mistake on the range `1 .. iterations` is the same (and a bit cleaner, IMO) as `0 ..< iterations`

Re: echo without new line or async write

2018-08-06 Thread Renesac
I concur that a for loop is much better, but you made a mistake on the range . And as the i will not be used inside the loop, is only a loop counter, I prefer to use the dummy variable _ instead to show that the value is being discarded. import os proc waitAndPrint(what:

Re: echo without new line or async write

2018-08-06 Thread Hlaaftana
Also you should probably use for loops in your specific example, just in case you didn't know what they were import os proc waitAndPrint(what: string, iterations: int, millisecs: int) = for i in 1..iterations: stdout.write what stdout.flushFile()

Re: echo without new line or async write

2018-08-06 Thread felipetorresini
I'll format, and thanks.

Re: echo without new line or async write

2018-08-06 Thread dom96
Please format your code as described in the "Code Blocks" section [here](https://forum.nim-lang.org/about/rst#code-blocks). I think you just need to write `stdout.flushFile()` after your `stdout.write`.