This is a question more out of curiosity, than strict necessity, and I know Nim is inspired more by languages like C, than those of Ruby, or Perl, but still...
Is there in Nim a built-in function that would act the same as Ruby's puts, or Python's print, or Perl's say, one that'd act much the same as Nim's echo: _echo("foon")_ , but instead implicitly/automatically adds a newline after itself (thus not a replacement of echo, but an addition to it with fulfills slightly different functionality?
I am sure there must be a way... I just haven't found it yet. Or is it an explicit, and intentional design decision not to have that? If so, I am not saying it's right, or wrong, I'd just be curious as to why...?
Ah, yes, it's an interesting difference that
echo ("First line") echo ("Second line")
prints the two lines right under each-other, and
echo ("First linen") echo ("Second line")
puts an empty newline between the two, whereas echo("First linenSecond line") is the same as the first case.
Now I've got it, thanks!
In your first case the output will be "First line\nSecondLine\n"
In the second case "First line\n\nSecnd line\n"
And the third case is the same as the first one.
I am sure there must be a way... I just haven't found it yet.
Sorry but why do you not first read a tutorial and learn the language before fixing my typos:
https://github.com/StefanSalewski/NimProgrammingBook/pull/5
Of course fixing the typos is very nice, but I think not that important.