[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH Elpa: streams.el] Add systematic tests against bogus element
From: |
Nicolas Petton |
Subject: |
Re: [PATCH Elpa: streams.el] Add systematic tests against bogus element generation |
Date: |
Fri, 16 Sep 2016 19:00:45 +0200 |
Michael Heerdegen <address@hidden> writes:
Hi Michael,
> +;; A note for developers: Please make sure to implement functions that
> +;; process streams (build new streams out of given streams) in a way
> +;; that no new elements in any argument stream are generated. This is
> +;; most likely an error since it changes the argument stream. For
> +;; example, a common error is to call `stream-empty-p' on an input
> +;; stream and build the stream to return depending on the result.
> +;; Instead, delay such tests until elements are requested from the
> +;; resulting stream. A way to achieve this is to wrap such tests into
> +;; `stream-make' or `stream-delay'. See the implementations of
> +;; `stream-append' or `seq-drop-while' for example.
Very good, thank you!
Feel free to push this patch.
Cheers,
Nico
signature.asc
Description: PGP signature