[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: On quitting and exiting
From: |
Andy Wingo |
Subject: |
Re: On quitting and exiting |
Date: |
Thu, 14 Mar 2013 09:55:21 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) |
On Thu 14 Mar 2013 05:40, Mike Gran <address@hidden> writes:
> In boot-9, a function `quit' is defined. It appears in the manual,
> but, in boot-9 it can take an argument. In the manual it never
> takes an argument.
>
> In boot-9, `exit' is aliased to quit. In the manual `exit' is
>
> undocumented; however, in the documentation in (rnrs programs),
> it notes that (rnrs programs)'s version of exit is the same
> as the "core" version of exit.
>
> And then there is primitive-exit and primitive-_exit, which are
> described in the manual.
>
> So clearly, there's some confusion here. Are 'quit' and 'exit'
> supposed to be API? Is the fact that they can take an argument
> supposed to be documented?
>
> Or is 'primitive-exit' the generally the way to go?
`primitive-_exit' is the C `_exit' function. It quits immediately,
without calling atexit() functions.
`primitive-exit' is the C `exit' function. It runs atexit() functions
and then quits.
The Scheme `exit' function throws `quit', which is handled by the
outermost catch handler, which calls the C `exit' function. In this way
calling Scheme's `exit' unwinds the dynamic stack.
They should all be documented.
Hope that helps,
Andy
--
http://wingolog.org/