import os, cpuinfo
echo getCurrentCompilerExe()
echo ("\nProcessor count ", countProcessors())
stdout.writeLine "produces no output"
: undeclared identifier: 'getCurrentCompilerExe'
Warning: a [b] will be parsed as command syntax; spacing is deprecated
Is getCurrentCompilerExe only intended for the Windows platform but not documented?
Can the a [b] warning be improved upon?
Which compiler did you use? Your program compiles correctly with 1.2.2 and #devel on a Linux platform.
Note that your use of echo is incorrect. As it is written, you write a tuple which contains the string "\nProcessor count " and an int. To get what you expect, you have to write:
echo "\nProcessor count ", countProcessors()
or
echo("\nProcessor count ", countProcessors())
without a space after echo.
wow Ubuntu Bionic package manager installs nim 0.17.2 !
Everything solved.
What would be the reason for the following output?
echo ("\nProcessor count ", countProcessors())
echo 1
echo ()
("\nProcessor count ", 4)
1
()
What would be the reason for the following output?
you are passing tuples
Space between function and parameters is important.
echo ("\nProcessor count ", countProcessors())
echo 1
echo ()
is same as:
echo(("\nProcessor count ", countProcessors())
echo(1)
echo(())
Just remove the space between function and parameters and you are all set.