From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master f6b5db6: Add support for generators Date: Tue, 03 Mar 2015 23:51:17 -0500 Message-ID: References: <20150302234252.19883.48595@vcs.savannah.gnu.org> <54F5FB63.3070203@dancol.org> <54F621A9.90508@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1425444711 11878 80.91.229.3 (4 Mar 2015 04:51:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Mar 2015 04:51:51 +0000 (UTC) Cc: emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 04 05:51:43 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YT1HZ-00054R-Pb for ged-emacs-devel@m.gmane.org; Wed, 04 Mar 2015 05:51:41 +0100 Original-Received: from localhost ([::1]:42044 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YT1HZ-0004Jv-3y for ged-emacs-devel@m.gmane.org; Tue, 03 Mar 2015 23:51:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YT1HW-0004Jd-Cs for emacs-devel@gnu.org; Tue, 03 Mar 2015 23:51:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YT1HT-0006DE-6c for emacs-devel@gnu.org; Tue, 03 Mar 2015 23:51:38 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:43083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YT1HT-0006DA-1F for emacs-devel@gnu.org; Tue, 03 Mar 2015 23:51:35 -0500 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t244pQ1H009327; Tue, 3 Mar 2015 23:51:27 -0500 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id BA8C5AE187; Tue, 3 Mar 2015 23:51:17 -0500 (EST) In-Reply-To: <54F621A9.90508@dancol.org> (Daniel Colascione's message of "Tue, 03 Mar 2015 13:03:37 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5234=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5234> : inlines <2350> : streams <1399619> : uri <1870541> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:183627 Archived-At: >> As I mentioned a bit further, the explanation about the difference >> between an iterator and a generator clarifies this, but comes >> a bit late. > Right. I'm not sure that level of detail is appropriate for the chapter > introduction though. Right. > I don't have one yet, and that's mostly because the higher-level > facilities I want to build on top of generators don't exist yet. Hmm... does that mean that the current code doesn't actually use the finalizers yet? > I added one already. Mind leaving it there? Your choice. >> Move the unwind-protect and the loop into a separate higher-order function. > I'm not sure that would help. The question is only whether it would work. > We need to keep the `iter-yield' in the body of the calling function > in order to be correct. But `iter-yield' is still (lexically) in the body of the calling function, passed as a callback to some new higher-order function. I guess another way to ask the same question is to ask if things like (mapcar (lambda (x) (iter-yield x)) list) can be used. Stefan