Search code examples
echoflushnim-lang

Does Nim have output buffering?


Do I have to flush output when I'm using Nim's echo like I do with Python's print? If yes, how can I do that?


Solution

  • You can flush stdout in Nim with flushFile(stdout): https://nim-lang.org/docs/system.html#flushFile,File_2

    But you don't have to do that since echo is equivalent to writeLine(stdout, x); flushFile(stdout): https://nim-lang.org/docs/system.html#echo,varargs[typed,]