mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-06-20 21:06:49 +02:00
23 lines
788 B
Text
23 lines
788 B
Text
|
|
;; (param) => get-cell + cdr
|
|
;; (param value) => get-cell + [convert] + set-cdr!
|
|
|
|
;; need 3 opcodes: param cell
|
|
;; context params
|
|
;; context-params-set!
|
|
|
|
;; analyze needs to translate param calls to proper usages of the
|
|
;; first two opcodes
|
|
|
|
;; (parameterize ((param value)) body ...)
|
|
;; => (let* ((old-params (thread-parameters))
|
|
;; (new-params (cons (cons param (param-convert value)) old-params)))
|
|
;; (dynamic-wind (lambda () (thread-set-parameters! new-params))
|
|
;; (lambda () body ...)
|
|
;; (lambda () (thread-set-parameters! old-params))))
|
|
|
|
(define-module (srfi 39)
|
|
(export make-parameter parameterize)
|
|
(import-immutable (scheme))
|
|
(include-shared "39/param")
|
|
(include "39/syntax.scm"))
|