Changeset 14485 in project


Ignore:
Timestamp:
04/28/09 05:30:59 (11 years ago)
Author:
Kon Lovett
Message:

Save.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/lookup-table/trunk/lookup-table.scm

    r14484 r14485  
    6464;; Association List
    6565
     66(define-inline (%make-alist-data test al) (%cons test al))
    6667(define-inline (%alist-dict-test data) (%car data))
    6768(define-inline (%alist-dict-alist data) (%cdr data))
     
    8586;; Hash Table
    8687
     88(define-inline (%make-htable-data test ht) (%cons test ht))
    8789(define-inline (%htable-dict-test data) (%car data))
    8890(define-inline (%htable-dict-htable data) (%cdr data))
     
    206208        (not (%undefined-value? (alist-dict-ref data key (%undefined-value)))) )
    207209
    208 (define (make-alist-dict test al) (%set-alist-dict-procs! (%make-dict (%cons test al))))
     210(define (make-alist-dict test al)
     211  (%set-alist-dict-procs! (%make-dict (%make-alist-data test al))) )
    209212
    210213(define (alist-dict? dict) (%eq? alist-dict-test-ref (%dict-test dict)))
    211214
    212215(define (become-alist-dict dict)
    213         (%dict-data-set! dict (%cons (%dict-test dict) (%dict->alist dict)))
     216        (%dict-data-set! dict (%make-alist-data (%dict-test dict) (%dict->alist dict)))
    214217        (%set-alist-dict-procs! dict) )
    215218
     
    257260        (hash-table-exists? (%htable-dict-htable data) key) )
    258261
    259 (define (make-htable-dict test ht) (%set-htable-dict-procs! (%make-dict (%cons test ht))))
     262(define (make-htable-dict test ht)
     263  (%set-htable-dict-procs! (%make-dict (%make-htable-data test ht))) )
    260264
    261265(define (htable-dict? dict) (%eq? htable-dict-test-ref (%dict-test dict)))
     
    263267(define (become-htable-dict dict)
    264268        (let ((test (%dict-test dict)))
    265                 (%dict-data-set! dict (%cons test (alist->hash-table (%dict->alist dict) test))))
     269                (%dict-data-set! dict (%make-htable-data test (alist->hash-table (%dict->alist dict) test))))
    266270        (%set-htable-dict-procs! dict) )
    267271
Note: See TracChangeset for help on using the changeset viewer.