update benz. (parameterize, object dictionary)

This commit is contained in:
Yuichi Nishiwaki 2014-09-15 16:00:19 +09:00
parent 83012f55a0
commit 1e29ad51a0
4 changed files with 4 additions and 20 deletions

View File

@ -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 @@
Subproject commit b20a97ed9fbc3bfcbf12158f4c2001d983e50c2d
Subproject commit 678d2484ec989b082d0db2dffda5d0a391cecc50

View File

@ -239,10 +239,7 @@
flush-output-port)
(export make-parameter
parameter-ref
parameter-set!
parameter-push!
parameter-pop!)
parameterize)
(export identifier?
identifier=?

View File

@ -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)