guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SRFI-13 implementation available


From: Martin Grabmueller
Subject: SRFI-13 implementation available
Date: Mon, 26 Mar 2001 18:36:27 +0200

Hello fellow Guilers,

I have just finished an implementation of SRFI-13 (string library).
You can download it at

  http://www.pintus.de/mgrabmue/guile/guile-srfi-13/guile-srfi-13-0.0.1.tar.gz

It is implemented as a shared library and written completely in C
(except for string-hash and string-hash-ci), comes with complete
Texinfo documentation and contains the following procedures:

   string-any string-every
   string-tabulate
   reverse-list->string
   string-join
   substring/shared string-copy!
   string-take string-take-right
   string-drop string-drop-right
   string-pad string-pad-right
   string-trim string-trim-right string-trim-both
   string-compare string-compare-ci
   string= string<>
   string< string>
   string<= string>=
   string-ci= string-ci<>
   string-ci< string-ci>
   string-ci<= string-ci>=
   string-hash string-hash-ci
   string-prefix-length string-prefix-length-ci
   string-suffix-length string-suffix-length-ci
   string-prefix? string-prefix-ci?
   string-suffix? string-suffix-ci?
   string-index string-index-right
   string-skip string-skip-right
   string-count
   string-contains string-contains-ci
   string-titlecase string-titlecase!
   string-reverse string-reverse!
   string-append/shared
   string-concatenate
   reverse-string-concatenate
   string-concatenate/shared
   reverse-string-concatenate/shared
   string-map string-map!
   string-fold string-fold-right
   string-unfold string-unfold-right
   string-for-each
   xsubstring string-xcopy!
   string-replace string-tokenize
   string-filter string-delete

The following low-level procedures (and syntax) are not implemented:

   string-parse-start+end
   string-parse-final-start+end
   let-string-start+end
   check-substring-spec
   substring-spec-ok?
   make-kmp-restart-vector
   kmp-step
   string-search-kmp

A few imcompatibilities remain: 

- Some of the SRFI-13 procedures, which are already in the Guile core
  are not fully compliant.  For example `string->list', `string-copy',
  `string-fill!' `string-upcase', `string-upcase!', `string-downcase'
  and `string-downcase!'do accept optional start/end indices in
  SRFI-13, but do not in Guile.

- The procedures `string-titlecase' and `string-titlecase!', which are
  just aliases for `string-capitalize' and `string-capitalize!' in my
  implementation do not accept start/end indices either.

- The procedure `string-index' in my implementation is not the same as
  in the core, because it accepts a predicate in addition to a single
  character as a search parameter.

Also I'd like to mention that performance may not be optimal yet.
Especially the string-unfolding and search procedures are implemented
naively at the moment.  I plan to fix that in future versions. But
anyway, the comparison of `string-concatenate' written in Scheme and
in C is quite promising.  String massaging becomes quite fast with
this library, mostly due to reduced consing and GC overhead.

I would really like to integrate these procedures into the Guile core,
because I think that most of these procedures are really useful and
should be available for everydays use.  The compatibility problems
should not be a problem, since SRFI-13 does extend the R5RS string
functions in a compatible way.

If the maintainers let me, I will add this C file to the Guile core
library.  But note: that would mean a new C file with about 2500 lines
of code in the core.

Best regards,
  'martin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]