This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Query on using `stream-cons' with srfi-14
- From: Kumar Appaiah <a dot kumar at alumni dot iitm dot ac dot in>
- To: kawa at sourceware dot org
- Date: Thu, 24 Jul 2014 09:11:42 +0530
- Subject: Re: Query on using `stream-cons' with srfi-14
- Authentication-results: sourceware.org; auth=none
- References: <20140723112307 dot GA11004 at odessa> <53CFF493 dot 9000706 at bothner dot com> <F9834209-FD29-419F-A84C-1F0D0AAA26DE at theptrgroup dot com>
On Wed, Jul 23, 2014 at 02:00:56PM -0400, Jamison Hope wrote:
> >
> >> What am I doing wrong? Please let me know if I am not being clear.
> >
> > stream-cons is syntax - specifically a macro.
> > It doesn't work to treat it as a value that is
> > available at run-time. (It might be reasonable for Kawa
> > to warn about this.)
> >
> > You would need to define cons-stream as a macro, for
> > example (untested code):
> >
> > (define-syntax cons-stream
> > (syntax-rules ()
> > ((_ a b) (stream-cons a b))))
>
>
> It'll also work to define cons-stream as an alias:
>
> (define-alias cons-stream stream-cons)
Thanks. This works perfectly.
> BTW the streams stuff is in SRFI-41, not SRFI-14. At first
> I was very confused by what the char-set library had to do
> with streams working or not working.
Sorry. This was an idiotic typo; the code actually "requires"
srfi-41. Sorry!
Kumar
--
Kumar Appaiah