From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#37888: 27.0.50; Streams and errors in element generation Date: Wed, 23 Oct 2019 16:58:48 +0200 Message-ID: <875zkfecev.fsf@web.de> References: <87eez3eduv.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="3962"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Nicolas Petton , Noam Postavsky To: 37888@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 23 17:15:02 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iNILl-0000qg-Lh for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Oct 2019 17:15:01 +0200 Original-Received: from localhost ([::1]:39264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNILk-0002QW-4Y for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Oct 2019 11:15:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34773) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNI7O-0007XC-AV for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2019 11:00:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNI7J-0000Mh-EF for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2019 11:00:10 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54211) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNI7J-0000MY-2B for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2019 11:00:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iNI7G-0001qX-K9 for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2019 11:00:05 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Oct 2019 15:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37888 X-GNU-PR-Package: emacs Original-Received: via spool by 37888-submit@debbugs.gnu.org id=B37888.15718427557010 (code B ref 37888); Wed, 23 Oct 2019 15:00:02 +0000 Original-Received: (at 37888) by debbugs.gnu.org; 23 Oct 2019 14:59:15 +0000 Original-Received: from localhost ([127.0.0.1]:34799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNI6U-0001p0-R7 for submit@debbugs.gnu.org; Wed, 23 Oct 2019 10:59:15 -0400 Original-Received: from mout.web.de ([212.227.15.4]:54331) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNI6R-0001om-TU for 37888@debbugs.gnu.org; Wed, 23 Oct 2019 10:59:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1571842721; bh=ImIlOixJvEazBgOyYeB/cnUZN4zziYIZPPd45PfEkJw=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=N2jS6FvrQ+8hteElfjPwQhU4QmZq0qUFkRhaV41ko9bjrgUlUsxVK3T5PCUPsRzRY dyc/RMiSIRJYNSxKLoereqyU5b80Vuauyrb0QaMjgt0nHdG4udjWqkpsylQN3oUJ2+ FK5GzING4vFspfofJQ8hCSVpUQ8ZetVXHJsAKFlw= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([94.218.222.9]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LePBV-1heaLd3lbZ-00q7nr; Wed, 23 Oct 2019 16:58:41 +0200 In-Reply-To: <87eez3eduv.fsf@web.de> (Michael Heerdegen's message of "Wed, 23 Oct 2019 16:27:36 +0200") X-Provags-ID: V03:K1:kX+2Afn1e03oCps9ooVEd/+c9gtRDF3tb2avbpKLgc0G1T5/rAj KO2xAW9JrIOMzIWg2UkUkdGAD1ERlG0/fJaR/UAC20QTlJhG+vkSYfW6FXlT5EeOixrXzxL MluPuGfFi6D1tJZ5z6dcTjuiSkEOAUX2F3F7TBRZfNVNZ6WWZFsSdLppf9tP30K7tTfzS22 zZn3IdLlp/COvlqf/2RfQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:lS0HhHRK220=:1M8UN0VuWAPqzcHr6f0Bv8 bFe5sQklOM4wIVoPI5q1ppJTFqVUUUqr+3UhDYV5em9zgc3rQUz6k2nYKbL3Wt+hSyUTIAKVm Nczjq+TK10q0/WgfJrV4Pd1yHK+kHx8SDEqcikDHJvPt48FvtttqupoeNGVNs8P3mPLLkE16t BTzOJx0B3lidW5d7FVTnBqhUovjosqezkDOxRNm5kNec0wA/0JWXc07IvF9s5BsP1plMZTNV0 RH3Y457lyjMKjVQUwPgyuKUVSUMmuGPbL68w7sdH2+Wjx3WYCDjc7FCSTSsK/8jOErEBXhCo4 zd/0bLjMWjXrjFQXsHobKetJCQAsUIXJwEQl0KvB0QZcKUSGrYuTOHTDl1dKmTAcNXmxd30lO q1R9+adSm8YJDKg5414EZl6LDiFUrYb3BgKiPn4wZeAPgQSgIlx5Ks0BReKoxK81NAH5ELdw2 sUPn5KcbwPl+aHr+S2/4kjdcnahFyDKS8WV30xu6ojewlaKC935D1kSDnjb4hH62dn45pcsd/ GqtpzacPW5c7T+UMIXWZlelmtUM7b3GNNBihK6QgY6ItJ/jqX01J1fLlY1zn5RtX5GC2zVlmG xhhWkXEz3N5+D6mUfoF8aWTUhMzEp8FXASEnhbrYytxhQy01tbwo+0fXY3nxO8DA13B5C+R8u IpHXvat95WqXWoQ6lD8cDSWX4jmnnl7nOgqz1e9i+jIeWR0dZ/nSj3jOwcMlQh6ay6vyqit4l 5H2WFkZ+ZxJH69A/e7HUiHcfecY8YSwAsCpVRVp8uCN//CGx8bCwBv4ZpY5QiVEUHPMU8JWg X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:170072 Archived-At: --=-=-= Content-Type: text/plain Michael Heerdegen writes: > (defun test-stream (n) > (stream-cons n (if (< n 0) (error "test") (test-stream (1- n))))) > > (setq my-stream (test-stream 10)) > > (condition-case nil (seq-length my-stream) > (error (message "Hmm, didn't work so well"))) > > Now, what happened to `my-stream' after evaluating this? If you try to > use it, you get a quite confusing error: > > (seq-length my-stream) > > |-- stream--force: Wrong type argument: streamp, (((n . -1) t) nil ...) Would something like this make sense (Noam)? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-WIP-stream-Fix-Bug-37888.patch Content-Transfer-Encoding: quoted-printable =46rom 4c778f26ff8d56d0e7018305aa3d46caa2f9fb38 Mon Sep 17 00:00:00 2001 From: Michael Heerdegen Date: Wed, 23 Oct 2019 16:55:01 +0200 Subject: [PATCH] WIP [stream] Fix Bug#37888 =2D-- packages/stream/stream.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/stream/stream.el b/packages/stream/stream.el index 9f73e8b861..d401fb7e3c 100644 =2D-- a/packages/stream/stream.el +++ b/packages/stream/stream.el @@ -86,8 +86,8 @@ That value is the one passed to `stream-make'." ((eq (car-safe stream) stream--evald-identifier) (cdr stream)) ((eq (car-safe stream) stream--fresh-identifier) - (setf (car stream) stream--evald-identifier) - (setf (cdr stream) (funcall (cdr stream)))) + (prog1 (setf (cdr stream) (funcall (cdr stream))) + (setf (car stream) stream--evald-identifier))) (t (signal 'wrong-type-argument (list 'streamp stream))))) (defmacro stream-cons (first rest) =2D- 2.23.0 --=-=-= Content-Type: text/plain Michael. --=-=-=--