From ddcfe68390ce8cb5625bcf8fc58b0a9370186b78 Mon Sep 17 00:00:00 2001 From: "Taylor R. Campbell" Date: Thu, 9 Oct 2003 18:50:19 +0000 Subject: [PATCH] Gah, _really_ a new PROCEDURE-TABLES library...I can't believe I forgot to 'cvs add' it before committing. --- s48/procedure-tables/AUTHORS | 1 + s48/procedure-tables/BLURB | 1 + s48/procedure-tables/README | 3 +++ s48/procedure-tables/interfaces.scm | 5 +++++ s48/procedure-tables/packages.scm | 14 ++++++++++++++ s48/procedure-tables/procedure-hash.scm | 11 +++++++++++ s48/procedure-tables/procedure-tables.scm | 8 ++++++++ 7 files changed, 43 insertions(+) create mode 100644 s48/procedure-tables/AUTHORS create mode 100644 s48/procedure-tables/BLURB create mode 100644 s48/procedure-tables/README create mode 100644 s48/procedure-tables/interfaces.scm create mode 100644 s48/procedure-tables/packages.scm create mode 100644 s48/procedure-tables/procedure-hash.scm create mode 100644 s48/procedure-tables/procedure-tables.scm diff --git a/s48/procedure-tables/AUTHORS b/s48/procedure-tables/AUTHORS new file mode 100644 index 0000000..7468301 --- /dev/null +++ b/s48/procedure-tables/AUTHORS @@ -0,0 +1 @@ +Taylor Campbell diff --git a/s48/procedure-tables/BLURB b/s48/procedure-tables/BLURB new file mode 100644 index 0000000..8660383 --- /dev/null +++ b/s48/procedure-tables/BLURB @@ -0,0 +1 @@ +procedure-tables: PROCEDURE-HASH and MAKE-PROCEDURE-TABLE for tables whose keys are procedures diff --git a/s48/procedure-tables/README b/s48/procedure-tables/README new file mode 100644 index 0000000..8e34d31 --- /dev/null +++ b/s48/procedure-tables/README @@ -0,0 +1,3 @@ +PROCEDURE-HASH defines PROCEDURE-HASH, which takes a procedure and +returns its hash value. PROCEDURE-TABLES defines MAKE-PROCEDURE-TABLE, +which returns a table whose keys are procedures. diff --git a/s48/procedure-tables/interfaces.scm b/s48/procedure-tables/interfaces.scm new file mode 100644 index 0000000..e3063ed --- /dev/null +++ b/s48/procedure-tables/interfaces.scm @@ -0,0 +1,5 @@ +(define-interface procedure-hash-interface + (export (procedure-hash (proc (:procedure) :exact-integer)))) + +(define-interface procedure-tables-interface + (export (make-procedure-table (proc () :value)))) diff --git a/s48/procedure-tables/packages.scm b/s48/procedure-tables/packages.scm new file mode 100644 index 0000000..8b8383e --- /dev/null +++ b/s48/procedure-tables/packages.scm @@ -0,0 +1,14 @@ +(define-structure procedure-hash procedure-hash-interface + (open scheme + more-types + loopholes + closures + disclosers + debug-data) + (files procedure-hash)) + +(define-structure procedure-tables procedure-tables-interface + (open scheme + tables + procedure-hash) + (files procedure-tables)) diff --git a/s48/procedure-tables/procedure-hash.scm b/s48/procedure-tables/procedure-hash.scm new file mode 100644 index 0000000..d898158 --- /dev/null +++ b/s48/procedure-tables/procedure-hash.scm @@ -0,0 +1,11 @@ +;;; This file is part of the Scheme Untergrund Library. + +;;; Copyright (c) 2003 by Taylor Campbell +;;; For copyright information, see the file COPYING which comes with +;;; the distribution. + +(define (procedure-hash proc) + (debug-data-uid + (template-debug-data + (closure-template + (loophole :closure proc))))) diff --git a/s48/procedure-tables/procedure-tables.scm b/s48/procedure-tables/procedure-tables.scm new file mode 100644 index 0000000..a8617ef --- /dev/null +++ b/s48/procedure-tables/procedure-tables.scm @@ -0,0 +1,8 @@ +;;; This file is part of the Scheme Untergrund Library. + +;;; Copyright (c) 2003 by Taylor Campbell +;;; For copyright information, see the file COPYING which comes with +;;; the distribution. + +(define make-procedure-table + (make-table-maker eq? procedure-hash))