From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Chris K. Jester-Young" Newsgroups: gmane.lisp.guile.devel Subject: SRFI 41 for Guile Date: Tue, 6 Dec 2011 14:37:28 -0500 Message-ID: <20111206193728.GB14416@yarrow.destinee.acro.gen.nz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1323200270 18628 80.91.229.12 (6 Dec 2011 19:37:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 6 Dec 2011 19:37:50 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Dec 06 20:37:46 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RY0pl-0000Z2-AF for guile-devel@m.gmane.org; Tue, 06 Dec 2011 20:37:45 +0100 Original-Received: from localhost ([::1]:54526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RY0pk-0002tT-Tf for guile-devel@m.gmane.org; Tue, 06 Dec 2011 14:37:44 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:59577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RY0pi-0002ry-If for guile-devel@gnu.org; Tue, 06 Dec 2011 14:37:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RY0pf-0002ek-Or for guile-devel@gnu.org; Tue, 06 Dec 2011 14:37:42 -0500 Original-Received: from mail-gx0-f169.google.com ([209.85.161.169]:54214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RY0pf-0002ea-IV for guile-devel@gnu.org; Tue, 06 Dec 2011 14:37:39 -0500 Original-Received: by ggnq4 with SMTP id q4so8042942ggn.0 for ; Tue, 06 Dec 2011 11:37:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; bh=O1WfevFQ6oeH2qVhRndmafOBtZiMHfnSO51+yqNDKkI=; b=QsyGFO/auC9Ll0U8M8axlX8+8XHH5fAWUds/kEF2cse4jiEjWtMWc0ejWBy5JgZUGg Z3P7PnzjvzuP3VwQGWE9RYl1Xn1Cmq7PRfmjBwS6/HhfKNTFkp3VB8XwXpCftkog4VnX UhxH9s9SSnW26po3KU0tGRSZph686sEkKaHXA= Original-Received: by 10.236.149.243 with SMTP id x79mr8326725yhj.92.1323200256774; Tue, 06 Dec 2011 11:37:36 -0800 (PST) Original-Received: from yarrow.destinee.acro.gen.nz (md82c36d0.tmodns.net. [208.54.44.216]) by mx.google.com with ESMTPS id c10sm38898751yhj.2.2011.12.06.11.37.32 (version=SSLv3 cipher=OTHER); Tue, 06 Dec 2011 11:37:35 -0800 (PST) Mail-Followup-To: guile-devel@gnu.org Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.169 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12996 Archived-At: Hi all, Just writing to say that after many months of being busy with other stuff, I finally got around to finishing my Guile port of SRFI 41: https://github.com/cky/guile2-modules Basically, both the code and the tests are based on the reference implementation, albeit with somewhat significant changes (as Andreas Rottmann pointed out ;-)) to make better use of Guile's features: + The tests use Guile's (test-suite lib) test framework. + define*/lambda* is used for handling optional arguments, rather than manual argument unpacking. In the odd case of stream->list where the optional argument is the leftmost one, I used case-lambda instead. + Guile's SRFI 45 is used directly, rather than reimplemented as in the reference implementation. + stream-match and stream-unfolds are complete rewrites. stream-match uses (ice-9 match), and stream-unfolds uses (ice-9 q) to store the unread results. + stream-constant uses circular-list to hold the values of interest, rather than...whatever the reference implementation does with append (see for yourself, if you're curious ;-)). The long and short is that whatever functionality is covered by an existing Guile module or builtin feature, I tried to make the best use of it. Still, I don't know every Guile module there is, so if I missed something, please let me know! Before anyone asks, though, I can't use (ice-9 streams)---it works on a very different streaming model from SRFI 41, as explained in the latter's introduction. Comments are very welcome. :-) Enjoy! Chris.