Changeset 38267 in project


Ignore:
Timestamp:
03/15/20 02:02:32 (2 weeks ago)
Author:
Kon Lovett
Message:

use zero?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/5/string-utils/trunk/memoized-string.scm

    r38017 r38267  
    1010  global-string
    1111  make-string+
    12   string+
    13   ;DEPRECATED
    14   memorize-string
    15   make-string*)
     12  string+)
    1613
    17 (import scheme
    18   (chicken base)
    19   (chicken type)
    20   (only srfi-1 every)
    21   (only srfi-69
    22     make-hash-table
    23     string-hash
    24     hash-table-ref/default hash-table-set!)
    25   (only unicode-utils
    26     ascii-codepoint?
    27     *unicode-string
    28     generic-make-string)
    29   (only type-checks
    30     check-natural-fixnum check-char check-string))
     14(import scheme)
     15(import (chicken base))
     16(import (chicken type))
     17(import (only (srfi 1) every))
     18(import (only (srfi 69) make-hash-table string-hash hash-table-ref/default hash-table-set!))
     19(import (only unicode-utils ascii-codepoint? *unicode-string generic-make-string))
     20(import (only type-checks check-natural-fixnum check-char check-string))
    3121
    3222;;
     
    4737(define (string+ . chars)
    4838  (let ((len (length chars)))
    49     (if (= 0 len)
    50       (*make-string+ 0 #f "")
     39    (if (zero? len) (*make-string+ 0 #f "")
    5140      (begin
    5241        (every (cut check-char 'string+ <>) chars)
     
    9786        (*make-string+ len ch (delay (generic-make-string len ch))) )
    9887      ((len ch str)
    99         (if (= 0 len)
    100           *empty-string*
     88        (if (zero? len) *empty-string*
    10189          (ensure-string-entry len ch str) ) ) ) ) )
    10290
    103 ;DEPRECATED
    104 
    105 (: memorize-string (deprecated global-string))
    106 (define memorize-string global-string)
    107 
    108 (: make-string* (deprecated make-string+))
    109 (define make-string* make-string+)
    110 
    11191) ;module memoized-string
Note: See TracChangeset for help on using the changeset viewer.