mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
Refactor
This commit is contained in:
parent
70e5aa14a3
commit
77dc8c3524
1 changed files with 8 additions and 6 deletions
|
@ -1,8 +1,8 @@
|
|||
|
||||
(define-library (scheme process-context)
|
||||
(import (chibi) (srfi 98))
|
||||
(cond-expand (windows (import (rename (only (chibi win32 process-win32) exit) (exit emergency-exit))))
|
||||
(else (import (rename (only (chibi process) exit) (exit emergency-exit)))))
|
||||
(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)
|
||||
|
||||
|
@ -10,9 +10,11 @@
|
|||
(define unwind #f)
|
||||
|
||||
((call/cc
|
||||
(lambda (continuation)
|
||||
(set! unwind continuation)
|
||||
(lambda (cont)
|
||||
(set! unwind cont)
|
||||
(lambda () #f))))
|
||||
|
||||
(define emergency-exit process-exit)
|
||||
|
||||
(define (exit . rest)
|
||||
(unwind (lambda () (apply emergency-exit rest))))))
|
||||
|
|
Loading…
Add table
Reference in a new issue