In Nim, to write code that executes as a sort of main function, you do (similar to the is main checks in Python):
when isMainModule:
echo ("Hello, Nim!")
However, for the life of me, I can't figure out how to return an error code. Traditionally there has always been an option to make main functions return int
, but since this is not actually in a proc
, it doesn't seem like you can return
; the only thing I've figured out how to do is to raise
an exception. Surely there is a way to just control whether your exit code is zero or not?