From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Nicolas Petton Newsgroups: gmane.emacs.devel Subject: Re: [PATCH Elpa: streams.el] Add systematic tests against bogus element generation Date: Fri, 16 Sep 2016 19:00:45 +0200 Message-ID: <87y42rok3m.fsf@petton.fr> References: <87y42rx5vt.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1474045436 22096 195.159.176.226 (16 Sep 2016 17:03:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Sep 2016 17:03:56 +0000 (UTC) To: Michael Heerdegen , Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 16 19:03:49 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkwYB-0004CU-9R for ged-emacs-devel@m.gmane.org; Fri, 16 Sep 2016 19:03:43 +0200 Original-Received: from localhost ([::1]:42755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkwYC-0007QX-Iv for ged-emacs-devel@m.gmane.org; Fri, 16 Sep 2016 13:03:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkwVZ-0006QI-8Y for emacs-devel@gnu.org; Fri, 16 Sep 2016 13:01:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkwVV-0004bi-0g for emacs-devel@gnu.org; Fri, 16 Sep 2016 13:01:01 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:47766) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkwVT-0004Ve-QS for emacs-devel@gnu.org; Fri, 16 Sep 2016 13:00:56 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id EC0FE204DD; Fri, 16 Sep 2016 13:00:47 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Fri, 16 Sep 2016 13:00:47 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=XUGb6I6sfJ1upjOJIkoq/9wlgEM=; b=hmZBS l567LHp/z9S0RA51ME4yFxJltMqYoKS/fQm0mEsKwQVcSG+03Yy+NQBEVd1CI07H T/IVmjgvr4+cnmpLh3QhbxfnlVFawYkRPybq2D2gWVNF/6lR8fGkcnsh/F8b0KUP xPd6T7srSALF1y3CTnGJpczGaqv5XjVrWVMjVg= X-Sasl-enc: iBW0oalcRh/UHVYg5xZsHqsNqn0v2kyQBskJFttQRRSq 1474045247 Original-Received: from blueberry (175.108.89.92.rev.sfr.net [92.89.108.175]) by mail.messagingengine.com (Postfix) with ESMTPA id 4A344F2C78; Fri, 16 Sep 2016 13:00:47 -0400 (EDT) In-Reply-To: <87y42rx5vt.fsf@web.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.26 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207467 Archived-At: --=-=-= Content-Type: text/plain Michael Heerdegen 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: GPGTools - http://gpgtools.org iQEcBAEBCAAGBQJX3CU9AAoJECM1h6R8IHkQEM8H/2/6HUmDy97stnmLeOjfMgGI Tu4I8QSqIkTrVkKQKr/z91ZTQ7Kiuyw9f/4kdsG/SMxe1Rh4tZzKiBbzTIQ+zXg5 bPBhgTHhU/l9fnoSBXG4kAf4kiKFSymMCf1ugHlGDO+VCTviyoG9k3IIxeRSVI94 Zz/ZPDIgTFH9RKuLEuTjUNlwsmcZTNVVla4byL2ifeuNoMmaNWt+IAH9XiURCeg7 YhM0ny4iTnJOlPvxBsHSklaqMAfFvPngBGn0PhO7hm62g1MtJpEdFUTYZoECM0jX cFOSi1Cx+1jFjJ4/rfNiHstY6ID9oqTSwgcZfDHDgZneMEvTwAy5PrVe/4IX1C0= =Ea9g -----END PGP SIGNATURE----- --=-=-=--