diff options
author | Grzegorz Adam Hankiewicz <gradha@imap.cc> | 2013-05-10 23:37:34 +0200 |
---|---|---|
committer | Grzegorz Adam Hankiewicz <gradha@imap.cc> | 2013-05-10 23:37:34 +0200 |
commit | c2bc187382aa0b567e3a6a8b4cefacd918efea0c (patch) | |
tree | f3f5ee9242e6df0df8d90874751ed056ac0115d8 /lib | |
parent | 2b517161e43ecb8904be69450a99b27c3571d5ca (diff) | |
download | Nim-c2bc187382aa0b567e3a6a8b4cefacd918efea0c.tar.gz |
Adds note to quit() about being called for termination.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system.nim | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/system.nim b/lib/system.nim index 5dafd6e13..4cdc212b9 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -909,12 +909,17 @@ var programResult* {.exportc: "nim_program_result".}: int proc quit*(errorcode: int = QuitSuccess) {. magic: "Exit", importc: "exit", noDecl, noReturn.} - ## stops the program immediately; before stopping the program the - ## "quit procedures" are called in the opposite order they were added - ## with ``addQuitProc``. ``quit`` never returns and ignores any - ## exception that may have been raised by the quit procedures. - ## It does *not* call the garbage collector to free all the memory, - ## unless a quit procedure calls ``GC_collect``. + ## Stops the program immediately with an exit code. + ## + ## Before stopping the program the "quit procedures" are called in the + ## opposite order they were added with ``addQuitProc``. ``quit`` never + ## returns and ignores any exception that may have been raised by the quit + ## procedures. It does *not* call the garbage collector to free all the + ## memory, unless a quit procedure calls ``GC_collect``. + ## + ## The proc ``quit(QuitSuccess)`` is called implicitly when your nimrod + ## program finishes without incident. A raised unhandled exception is + ## equivalent to calling ``quit(QuitFailure)``. template sysAssert(cond: bool, msg: string) = when defined(useSysAssert): |