From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#59140: 29.0.50; iter-yield from lambda Date: Wed, 09 Nov 2022 02:22:56 +0100 Message-ID: <87sfissyz3.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21753"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: okamsn@protonmail.com To: 59140@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 09 02:24:07 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1osZp0-0005RX-DO for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 09 Nov 2022 02:24:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1osZox-0003UR-8j; Tue, 08 Nov 2022 20:24:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osZow-0003UJ-9k for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2022 20:24:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1osZow-0001jy-0B for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2022 20:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1osZov-0000zG-Qp for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2022 20:24:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Nov 2022 01:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59140 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16679569903723 (code B ref -1); Wed, 09 Nov 2022 01:24:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Nov 2022 01:23:10 +0000 Original-Received: from localhost ([127.0.0.1]:38448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1osZo5-0000xz-TT for submit@debbugs.gnu.org; Tue, 08 Nov 2022 20:23:10 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:58728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1osZo4-0000xs-Hn for submit@debbugs.gnu.org; Tue, 08 Nov 2022 20:23:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osZo4-0003RT-Cs for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2022 20:23:08 -0500 Original-Received: from mout.web.de ([217.72.192.78]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osZny-0001dC-Gz for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2022 20:23:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1667956977; bh=kZ30HP4hkQ7lTeqGiUp2mVTVImDghEYOYs2bMUZt6ok=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=c9RUWiyQluQqags+/mbrMWTdOCV8xLu2KU70Jtj84eRspXkCgPeW81oWyptsTNgpz uORFf0JcWQ50gtAyzq2G4iCbsLRhlW7+jZl7kG17JiY8WaiVWOviy2NUz31hL35/TC 7rTZLCFECVdR/vpkCy6gZCNoTVjmBnHGIqf6vPjpDdofzf+N6QipvALZXxqJvwOctT tb1KX5SQZwkM1UEBI7c7qxLUofZrVsdgkbiBCMjGsisV3sWPysx6dBlcq9gtHZYC9o AIE6iIhaF1J9AltH/SDXuBjvMaDhS5FbKbjdCxJ+BHV3Wyq9e8l24ZVkVNi6UH1XYt fRyCMA+A5rJZQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from drachen.dragon ([88.66.71.129]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1N79N8-1p4wg92IFY-017fPO; Wed, 09 Nov 2022 02:22:57 +0100 X-Provags-ID: V03:K1:iWZZ5Tqy/6hOAzVnXwGDge0US8p5djHL+aR96aosEquoH1Hs5ev wqCjIHzGq1muJjkgYj636pNKjDUnyRCy06hFHd3lOY2xh2/qdy7YMkTR0LZj2N2dFpQlh41 WRT5R5eFFDa0z8L/owOt+M9ypdAo/nBI1eY+vAoOySHFp6WjChV6FQ0zB9na/+yxksUpb9v pZJbKdvJwQtP9IMFh3kPg== UI-OutboundReport: notjunk:1;M01:P0:D+eria/AiwQ=;Pxt+wrWuGh07Q71m8cNQf7qcvU9 dKBhgL35dVwg70bj2aBGqFwNgG6/Z0SCuj41rj1kW9AfhbyupGsGohQr5fDOx7w24v5G2oYzc Ov0BfWwO82N2LhnxqmRqgIxWuP/CdlSZfdqmLZB3ANO0KBvEJYs2aQNPmSdtTED9EBMRNq8QF QRZeD3DJrnGwNpPdX+GEtziIBwujspOqCRMKjdPc+CUyAlKHPZOWpJhGLQ3tf6HQoSJS68k1X utFDXAvit+1EEn/h7GOLcyfoIQLWK7a8lqXDfG0KHSWMg3Dm5bgCSL2szNgf8cTpQRWpQxgYr hYx7zXTx4eX5bICoSuApWEqGFuRwQRgIp2BnyyToMUgdrDEdRPeL8C0jYirXt3SBMeSgOA5x9 VMLImpW5a7juWpTyfM/uqknI0a1XkfNOnJi56AoUtQI9auQc0jFumPztrHX9Y8iNd37h3KNM7 i/BOM6Wr8E0rnBr6H+IrecIUKOv+Ze0YHEcVyMxLTk768fzH7QEyLMOl3G2gMqssvRkty/8JN Pc8K97w9fvm7v05eq03tEcG9tEaDehBHP9v42FVDWlsBdxaRr68We2m9wRPBj71IMvZa50G9Z 0LTkFoz+9bFPQNd26UqI+e/VF6jnI9g4hzEv3A2kTkEpy/c2UifZa5ARF74XbXGdZAJfDGMvi eDagp+/cO4FKgWIB6a9i3CxrQRfkzhusCp4O9m1rbPQeo8zo7OJfHztv09MU0PWqAv78HTKy0 Y3tCWK0DcSHjxuIk0ZwfDOCCD700+l6jUe9eqdJx+ILycKtfMjJpg5QY/Xjg3s02PKg5Yv30 Received-SPF: pass client-ip=217.72.192.78; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:247376 Archived-At: Hello, In emacs-help (Okamsn ) it has been pointed to the issue that `iter-yield' (from generator.el) is not supported in some contexts - contexts where yielding happens from inside a lambda expression or directly (like here when mapping over a sequence), e.g. (setq iter-maker (iter-lambda (x) (seq-doseq (item x) (iter-yield item)))) (setq my-iter (funcall iter-maker '(1 2 3))) (iter-next my-iter) ~~> (void-function cps-internal-yield) (seq-doseq expands to more or less just mapc+lambda) or (setq iter-maker (iter-lambda (x) (seq-do #'iter-yield x))) (setq my-iter (funcall iter-maker '(1 2 3))) (iter-next my-iter) ~~> (error "=E2=80=98iter-yield=E2=80=99 used outside a generator") These examples are written correctly but seem to hit an undocumented limitation of the implementation in generator.el I quote Stefan Monnier answering what should be done: > IIRC, one of the main limitations of `generator.el` is that it doesn't > handle `lambda` (and neither should you use `#'iter-yield`, IIRC). >=20 > I don't really know how to go about fixing it. >=20 > A good first step would be to make sure it emits an error (or a warning) > when you use `#'iter-yield` or when you call `#'iter-yield` from with > a lambda expression. TIA, Michael.