chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Trying to understand srfi-41 (streams)


From: Bahman Movaqar
Subject: [Chicken-users] Trying to understand srfi-41 (streams)
Date: Sat, 28 Jan 2017 23:19:01 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0

I've been playing around `srfi-41` for an hour now.  It seems to me,
that regardless of the operations on the stream, the `head` doesn't
advance.  For example:

    (define my-stream (list->stream '(0 1 2 3)))
    (take 2 my-stream)

At this point I was expecting the stream head to have advanced by 2.
But this fails:

    (assert (equal? (stream-car my-stream) 2))

And of course, upon further investigation, the head hadn't moved an inch
after `take` or `car`.  What am I missing?

Thanks,

-- 
Bahman Movaqar

http://BahmanM.com - https://twitter.com/bahman__m
https://github.com/bahmanm - https://gist.github.com/bahmanm
PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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