chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] sequences egg


From: Thomas Chust
Subject: Re: [Chicken-users] sequences egg
Date: Fri, 19 Nov 2010 13:17:17 +0100

2010/11/19 Felix <address@hidden>:
> From: Thomas Chust <address@hidden>
>> [...]
>> in my opinion this library is a good idea. A feature I would like to see in 
>> this
>> kind of library would be some comprehension mechanism (similar to SRFI-42 or
>> Racket's for comprehensions).
>
> I guess this would probably be suited for a separate extension. Ideally,
> one could try to extend SRFI-42 to handle this, even though doing so
> requires digging into its implementation, which appears frightningly
> complex...
> [...]

Hello,

ok, arguably comprehensions do belong into a separate library. After all, the
functionality of SRFI-42 and the sequences library has significant overlap.

For what it's worth, I think integrating the sequences library with SRFI-42 is
trivial, though, because SRFI-42 is very conveniently extensible. An
implementation of a sequences based iterator for SRFI-42 is attached for anyone
who wants to play around with it :-)

I also encountered another weird behaviour that I consider a bug: The expression
(at-end? (iterator '())) evaluates to #f, which ultimately results in iterators
over lists never detecting the end of the list when they are stepped through!

Ciao,
Thomas


-- 
When C++ is your hammer, every problem looks like your thumb.

Attachment: srfi-42-sequences.scm
Description: Text Data


reply via email to

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