|
Oktatás * Programozás 1 * Szkriptnyelvek Teaching * Programming 1 (BI) Félévek Linkek * kalendárium |
Nim2 /
echoSimilar to Python's echo "hello nim" # hello nim echo 2, true, 3.14 # 2true3.14 echo(2, true, 3.14) # 2true3.14 In Nim, parentheses for procedure calls are optional when there is no ambiguity. This is a general language rule, not specific to If you don't need the automatic newline, use stdout.write("hello ") stdout.write("nim") stdout.write("\n")
Why is it echo() and not print() ?It's one character shorter. You need to type less :) You can print anything with stdout.write()Similarly to
𝥶This time Nim has the advantage. How does it work? Implicitly, it converts the input parameters to string with the What is echo() then?From the docstring of Flushing means that it prints immediately to the standard output without buffering. |
![]() Blogjaim, hobbi projektjeim * The Ubuntu Incident [ edit ] |
||||