Changeset 35807 in project


Ignore:
Timestamp:
07/08/18 20:05:44 (11 days ago)
Author:
kon
Message:

drop reexport egg modules for functional ones

Location:
release/5/string-utils/trunk
Files:
2 edited

Legend:

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

    r35796 r35807  
    33
    44((synopsis "String Utilities")
    5  (version "2.0.1")
     5 (version "2.0.2")
    66 (category data)
    77 (author "[[kon lovett]]")
     
    4343    #;(inline-file)
    4444    (types-file)
    45     (component-dependencies unicode-utils string-hexadecimal memoized-string)
     45    (component-dependencies memoized-string)
    4646    (csc-options "-O3" "-d1" "-no-procedure-checks") ) ) )
  • release/5/string-utils/trunk/string-utils.scm

    r35791 r35807  
    33;;;; Kon Lovett, Aug '10
    44
    5 (module string-utils ()
     5(module string-utils
    66
    7 (import scheme (chicken module))
    8 (import memoized-string unicode-utils string-hexadecimal)
     7(;export
     8  string-fixed-length)
    99
    10 (reexport memoized-string unicode-utils string-hexadecimal)
     10(import scheme
     11  (chicken fixnum)
     12  (chicken type)
     13  (only memoized-string make-string+)
     14  (only type-checks check-char check-string check-fixnum ))
     15
     16(: string-fixed-length (string fixnum #!rest --> string))
     17;
     18(define (string-fixed-length s n #!key (pad-char #\space) (trailing "..."))
     19  (let (
     20    (rem
     21      (fx-
     22        (check-fixnum 'string-fixed-length n)
     23        (string-length (check-string 'string-fixed-length s)))) )
     24    (if (positive? rem)
     25      (string-append s (make-string+ rem (check-char 'string-fixed-length pad-char)))
     26      (let (
     27        (lim (fx- n (string-length (check-string 'string-fixed-length trailing)))) )
     28        (if (positive? lim)
     29          (string-append (substring s 0 lim) trailing)
     30          trailing ) ) ) ) )
    1131
    1232) ;module string-utils
Note: See TracChangeset for help on using the changeset viewer.