commander-s/scheme/focus.scm

23 lines
715 B
Scheme
Raw Normal View History

2005-06-01 06:04:21 -04:00
(define-record-type focus-table :focus-table
(really-make-focus-table table count)
focus-table?
(table focus-table-table)
(count focus-table-count set-focus-table-count!))
(define (make-empty-focus-table)
(really-make-focus-table (make-integer-table) 0))
(define (add-focus-object focus-table object)
(let ((count (+ 1 (focus-table-count focus-table))))
2005-06-01 07:26:22 -04:00
(set-focus-table-count! focus-table count)
2005-06-01 06:04:21 -04:00
(table-set!
(focus-table-table focus-table) count object)
count))
(define (get-focus-object focus-table index)
(table-ref (focus-table-table focus-table) index))
(define (make-focus-object-reference table obj)
(let ((id (add-focus-object table obj)))
2005-08-21 12:55:34 -04:00
`(focus-value-ref ,id)))