Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 43b0eddce9
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (20 sloc) 0.637 kB
;;; 環境
(define-module env
(use srfi-1)
(export append-env get-value set-value!)
(define *global-env* (make-hash-table))
(define (append-env keys values env)
(append (map cons keys values)
(alist-copy env)))
(define (get-value symbol . opt)
(let1 env (assoc symbol (get-optional opt '()))
(if (pair? env)
(cdr env)
(hash-table-get *global-env* symbol))))
(define (set-value! symbol value . opt)
(let1 env (assoc symbol (get-optional opt '()))
(if (pair? env)
(set! (cdr env) value)
(hash-table-put! *global-env* symbol value))
value))
)
Jump to Line
Something went wrong with that request. Please try again.