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