((#x00020100 #x0004030000020100) #f)
(else (error "Unable to determine endianness of host."))))
(add-secondary-gc-daemon! clean-obarray)
- (set! hook/exit (make-parameter default/exit))
- (set! hook/%exit (make-parameter default/%exit))
- (set! hook/quit (make-parameter default/quit))
+ (set! param:exit-hook (make-settable-parameter default/exit))
+ (set! param:%exit-hook (make-settable-parameter default/%exit))
+ (set! param:quit-hook (make-settable-parameter default/quit))
;; Kludge until the next released version, to avoid a bootstrapping
;; failure.
(set! ephemeron-type (microcode-type 'EPHEMERON))
(if (< (real-time-clock) end)
(wait-loop)))))
+(define hook/exit #!default)
+(define hook/%exit #!default)
+(define hook/quit #!default)
+
+(define param:exit-hook)
+(define param:%exit-hook)
+(define param:quit-hook)
+
+(define (get-exit-hook)
+ (if (default-object? hook/exit)
+ (param:exit-hook)
+ hook/exit))
+
+(define (get-%exit-hook)
+ (if (default-object? hook/%exit)
+ (param:%exit-hook)
+ hook/%exit))
+
+(define (get-quit-hook)
+ (if (default-object? hook/quit)
+ (param:quit-hook)
+ hook/quit))
+
(define (exit #!optional integer)
- ((hook/exit) (if (default-object? integer) #f integer)))
+ ((get-exit-hook) (if (default-object? integer) #f integer)))
(define (default/exit integer)
(if (prompt-for-confirmation "Kill Scheme")
(%exit integer)))
-(define hook/exit)
-(define hook/%exit)
-
(define (%exit #!optional integer)
- ((hook/%exit) integer))
+ ((get-%exit-hook) integer))
(define (default/%exit #!optional integer)
(event-distributor/invoke! event:before-exit)
((ucode-primitive exit-with-value 1) integer)))
(define (quit)
- ((hook/quit)))
+ ((get-quit-hook)))
(define (%quit)
(with-absolutely-no-interrupts (ucode-primitive halt))
unspecific)
(define default/quit %quit)
-(define hook/quit)
(define user-initial-environment
(*make-environment system-global-environment