chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Library for manipulating srfi-40 streams


From: Alejandro Forero Cuervo
Subject: [Chicken-users] Library for manipulating srfi-40 streams
Date: Mon, 12 Jul 2004 23:20:16 -0500
User-agent: Mutt/1.5.6+20040523i

Hello.

I'm   working  in   an  egg,   stream-ext,  with   functions  for
manipulating srfi-40 streams.  It is available at:

    
http://anonymous:@svn.afc.no-ip.info:8000/svn/home/src/chicken-eggs/stream-ext/stream-ext.scm

The documentation is available at:

    
http://anonymous:@svn.afc.no-ip.info:8000/svn/home/src/chicken-eggs/stream-ext/stream-ext.html

[Both URLs assume my home machine is turned on, which it isn't at
nights in GMT-5.]

The  interface is  designed  for consistence  with the  semantics
of  the  functions  in  srfi-1.  For  example,  srfi-1  specifies
the  functions  make-list,  list-tabulate   and  take,  which  in
this   library  have   their   stream  equivalents   make-stream,
stream-tabulate and stream-take.

This  egg defines  a make-stream  function which,  unfortunately,
clashes with a function in the  srfi-40 egg.  The function in the
srfi-40 egg needs to be exported only because stream-cons depends
on it.  However,  make-stream is not specified in  srfi-40 and it
would  be strange  if any  user code  depends on  it (other  than
for  the  expansion of  the  stream-cons  macro).  The  reference
implementation  for  srfi-40  states: "The  following  names  not
specified in this SRFI are  used in the reference implementation:
and, any, make-stream, ...". For that reason, one must rename the
egg's  function to  some  other  name.  This  allows  the egg  to
provide  a  make-stream  function  with  the  same  semantics  of
make-list (but returning a stream  rather than a list).  For this
reason, I  would kindly  like to  ask Felix  to please  apply the
attached  patch  to the  contents  of  the srfi-40  egg  (created
against the contents of the  currently published egg).  Sorry for
the inconvenience, Felix! :/

I have used  the stream-ext egg (in combination  with some others
that I  plan to  release in the  following weeks)  for developing
small  applications  that  use  streams  of  chars  to  represent
strings/ports (instead  of using native strings  or ports).  This
allows me to parse inputs very easily without having to keep them
in memory, in  a programming style that is  relatively similar to
the one used by Haskell (and probably other functional languages)
programmers for handling  streams/ports/strings (though still not
as useful; we could really use some pattern-matching mechanism).

Disclaimer:  I haven't got around to testing all the functions in
the  library.  They  could have  some obvious  (and perhaps  some
non-obvious) bugs.

The egg is in the public domain; I hope others find it useful.  I
will probably  improve it  in the  future adding  more functions.
There are  some functions  in srfi-1  that should  have analogous
functions in this egg but still don't.

Your comments are appreciated.

Alejo.
http://bachue.com/alejo

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

Attachment: patch
Description: Text document


reply via email to

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