mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
20 lines
619 B
Scheme
20 lines
619 B
Scheme
|
|
(define-library (scheme process-context)
|
|
(import (chibi) (only (scheme base) call/cc) (srfi 98))
|
|
(cond-expand (windows (import (rename (chibi win32 process-win32) (exit emergency-exit))))
|
|
(else (import (prefix (chibi process) process-))))
|
|
(export get-environment-variable get-environment-variables
|
|
command-line exit emergency-exit)
|
|
|
|
(begin
|
|
(define unwind #f)
|
|
|
|
((call/cc
|
|
(lambda (cont)
|
|
(set! unwind cont)
|
|
(lambda () #f))))
|
|
|
|
(define emergency-exit process-exit)
|
|
|
|
(define (exit . rest)
|
|
(unwind (lambda () (apply emergency-exit rest))))))
|