update benz. (parameterize, object dictionary)
This commit is contained in:
+2
-2
@@ -229,7 +229,7 @@ Technically, picrin's array is implemented as a ring-buffer, effective double-en
|
||||
(picrin dictionary)
|
||||
-------------------
|
||||
|
||||
Symbol to Object table. Internally it is implemented on hash-table.
|
||||
Object-to-object table. Internally it is implemented on hash-table. Equivalence is tested with equal? procedure.
|
||||
|
||||
Note that dictionary is not a weak map; if you are going to make a highly memory-consuming program with dictionaries, you should know that dictionaries keep their bound objects and never let them free until you explicitly deletes bindings.
|
||||
|
||||
@@ -243,7 +243,7 @@ Note that dictionary is not a weak map; if you are going to make a highly memory
|
||||
|
||||
- **(dictionary-ref dict key)**
|
||||
|
||||
Look up dictionary dict for a value associated with symbol key. It returns two values: first is the associated value if exists, and second is a boolean of lookup result.
|
||||
Look up dictionary dict for a value associated with key. It returns two values: first is the associated value if exists, and second is a boolean of lookup result.
|
||||
|
||||
- **(dictionary-set! dict key obj)**
|
||||
|
||||
|
||||
+1
-1
Submodule extlib/benz updated: b20a97ed9f...678d2484ec
@@ -239,10 +239,7 @@
|
||||
flush-output-port)
|
||||
|
||||
(export make-parameter
|
||||
parameter-ref
|
||||
parameter-set!
|
||||
parameter-push!
|
||||
parameter-pop!)
|
||||
parameterize)
|
||||
|
||||
(export identifier?
|
||||
identifier=?
|
||||
|
||||
@@ -69,19 +69,6 @@
|
||||
|
||||
;; 4.2.6. Dynamic bindings
|
||||
|
||||
(define-syntax parameterize
|
||||
(ir-macro-transformer
|
||||
(lambda (form inject compare)
|
||||
(let ((formal (car (cdr form)))
|
||||
(body (cdr (cdr form))))
|
||||
(let ((vars (map car formal))
|
||||
(vals (map cadr formal)))
|
||||
`(begin
|
||||
,@(map (lambda (var val) `(parameter-push! ,var ,val)) vars vals)
|
||||
(let ((result (begin ,@body)))
|
||||
,@(map (lambda (var) `(parameter-pop! ,var)) vars)
|
||||
result)))))))
|
||||
|
||||
(export make-parameter
|
||||
parameterize)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user