table.scm 450 B

12345678910111213141516
  1. ; Copyright (c) 1993-2007 by Richard Kelsey and Jonathan Rees. See file COPYING.
  2. ; unworthy of copyright notice
  3. (define (make-table . hash-procedure-option) (list 'table))
  4. (define (table-ref table key)
  5. (let ((probe (assq key (cdr table))))
  6. (if probe (cdr probe) #f)))
  7. (define (table-set! table key value)
  8. (let ((probe (assq key (cdr table))))
  9. (if probe
  10. (set-cdr! probe value)
  11. (set-cdr! table (cons (cons key value) (cdr table))))))