From 7eb766e2b14ca91061f9e2350a291a10d54507e8 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 10 May 1991 04:50:30 +0000 Subject: [PATCH] Change implementation of string tables to allow case-sensitive tables. Change apropos operation to match against a regular expression rather than a string. --- v7/src/edwin/strtab.scm | 88 ++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/v7/src/edwin/strtab.scm b/v7/src/edwin/strtab.scm index b4d36abe2..9048dd77b 100644 --- a/v7/src/edwin/strtab.scm +++ b/v7/src/edwin/strtab.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/strtab.scm,v 1.42 1989/08/11 11:12:19 cph Rel $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/strtab.scm,v 1.43 1991/05/10 04:50:30 cph Exp $ ;;; -;;; Copyright (c) 1985, 1989 Massachusetts Institute of Technology +;;; Copyright (c) 1985, 1989-91 Massachusetts Institute of Technology ;;; ;;; This material was developed by the Scheme project at the ;;; Massachusetts Institute of Technology, Department of @@ -48,19 +48,25 @@ (define-structure (string-table (constructor %make-string-table)) vector - size) + size + ci?) -(define (make-string-table #!optional initial-size) +(define (make-string-table #!optional initial-size ci?) (%make-string-table (make-vector (if (default-object? initial-size) 16 initial-size)) - 0)) + 0 + (or (default-object? ci?) ci?))) -(define (alist->string-table alist) - (let ((v - (list->vector - (sort alist (lambda (x y) (string-cistring-table alist #!optional ci?) + (let ((ci? (or (default-object? ci?) ci?))) + (let ((v + (list->vector + (sort alist + (if ci? + (lambda (x y) (string-ci