From: Vassil Nikolov
Subject: EXIT (Ex: Re: some small proposed changes to standard)
Date: 
Message-ID: <l03130301b3bcf7af54ec@195.138.129.78>
Mark Stickel wrote:                [1999-07-20 21:20 -0700]
(to the ·····@ai.sri.com list)

Among other items:

  > 3. EXIT function proposed language addition:
  > 
  > Common Lisp lacks a standard means to exit the running Lisp image.
  > Exiting is often needed and is currently provided under different
  > names by different implementations, e.g., EXIT in Allegro Common Lisp,
  > QUIT in Liquid Common Lisp, and BYE in GNU Common Lisp.
  > 
  > Languages including C, Perl, and Python provide for returning an
  > integer status to the operating system.  Common Lisp should also be
  > capable of this as needed.  A function with calling pattern (EXIT
  > &optional (status 0)) might suffice.  Alternatively, a broader
  > range of behavior might be specifiable by (possibly implementation
  > specific) keywords such as :STATUS, :REBOOT, etc.

I think that one also would want an *EXIT-HOOK* here, if not some
more complicated machinery.

  *EXIT-HOOK*
  [Variable]

  The value of *EXIT-HOOK* must be either NIL or a funcallable
  object.  When EXIT is called, if the value not NIL, it is applied
  on the arguments passed to EXIT prior to exiting Lisp.

  If an error occurs during the execution of the function, the
  results are implementation-defined.  (E.g. the implementation
  might provide another variable that controls whether the
  debugger is entered or just an error message is printed and
  Lisp is terminated anyway.)

  The initial value of *EXIT-HOOK* is implementation-defined.

Also, to decrease OS dependence, maybe the default for the optional
status argument had better be :SUCCESS or something like that,
with :FAILURE defined as another standardised value.

(This is obviously taken from C.)


Vassil Nikolov
Permanent forwarding e-mail: ········@poboxes.com
For more: http://www.poboxes.com/vnikolov
  Abaci lignei --- programmatici ferrei.