Email list hosting service & mailing list manager


Library of functions for manipulating streams Alejandro Forero Cuervo 14 Sep 2004 03:15 UTC
Hello.

I am using streams in quite a few programs already.  One of them,
svnwiki, uses them for a subversion-based wiki program, which you
can see running at:

  http://ingenieria.ean.edu.co/~azul/svnwiki.cgi/ean/fin/default

Strings  are represented  as streams  of character  everywhere in
this program (and many others I'm writing).  In order to do this,
I wrote a set of higher-level functions for manipulating streams.
Some of them  are specific to streams of characters  but most are
general.

I  have written  this  library  to work  in  Chicken Scheme,  the
implementation  I'm most  familiar  with.  However,  most of  the
functions  should  be  easy  to  port  to  other  implementations
(actually most should work out-of-the-box).  The documentation is
available at:

  http://www.call-with-current-continuation.org/eggs/stream-ext.html

The source code is in the public domain.  You can download it at:

  http://www.call-with-current-continuation.org/eggs/stream-ext.scm

I understand  that srfi-41 was  reserved for a library  of higher
level functions for manipulating  streams.  However, Googling for
srfi-41 turns  out no useful  results.  Are there  other existing
libraries  for  manipulating  streams?   If  there  is  interest,
I  could  create  a  draft  to serve  as  srfi-41  based  on  the
documentation of my library (probably removing a few non-portable
functions such as stream-grep).

I  don't want  to  have to  change my  programs  if the  standard
interface  adopted for  higher-level manipulation  of streams  is
incompatible with my  library.  If I have to do  this, the sooner
the better.

The interface for  the functions in my library is  designed to be
as coherent as possible with that  of the functions in srfi-1 and
r5rs, replacing  ``list-'' with  ``stream-'' in their  names (or,
sometimes, just  prefixing them with ``stream-'').   The order of
the  arguments  is  preserved  most  (all?)  of  the  times.   I,
however, did  add a  few functions,  such as  stream-butlast-n or
stream-last-n,  that  have  no direct  list-based  equivalent  in
srfi-1 (nor r5rs).

Thanks!

Alejo.
http://bachue.com/alejo

---=(  Comunidad de Usuarios de Software Libre en Colombia  )=---
---=(  http://bachue.com/colibri )=--=( xxxxxx@bachue.com  )=---