From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: Generator Examples Date: Sun, 25 Sep 2016 03:03:32 +0200 Message-ID: <87twd4lriz.fsf@web.de> References: <22499.10814.549580.139539@gargle.gargle.HOWL> <87y42gltoy.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1474765469 15788 195.159.176.226 (25 Sep 2016 01:04:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 25 Sep 2016 01:04:29 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: emacs-devel@gnu.org To: raman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 25 03:04:26 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 1bnxrh-00038h-8Q for ged-emacs-devel@m.gmane.org; Sun, 25 Sep 2016 03:04:21 +0200 Original-Received: from localhost ([::1]:36136 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnxrf-0004hF-OR for ged-emacs-devel@m.gmane.org; Sat, 24 Sep 2016 21:04:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnxr6-0004dh-QY for emacs-devel@gnu.org; Sat, 24 Sep 2016 21:03:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnxr2-0001iU-KA for emacs-devel@gnu.org; Sat, 24 Sep 2016 21:03:43 -0400 Original-Received: from mout.web.de ([217.72.192.78]:53260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnxr2-0001iO-9o for emacs-devel@gnu.org; Sat, 24 Sep 2016 21:03:40 -0400 Original-Received: from drachen.dragon ([90.186.0.76]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0LshSX-1aqTVB1PR3-012GTV; Sun, 25 Sep 2016 03:03:37 +0200 In-Reply-To: (raman@google.com's message of "Sat, 24 Sep 2016 17:29:49 -0700") X-Provags-ID: V03:K0:2/jQDlT2cw5gyXos7aKYg67/E1fUFm0aKx2rJPSCUsq/3ybD7Bs Zh2mtdCTVDEz6o1EGEGye7gKu3SilLlqZyt4PX+hJS9w+dUo5l2SrTfxP0Achn/5nk0HZba BWX2vh/xYSQvdpyLCLpPAM+Er3vnH0DemDolWPzCDgVw4a/4TCzg8jiPid0oUX8IxEfiU6F n6SmqzzMMpBhccNoGVOAw== X-UI-Out-Filterresults: notjunk:1;V01:K0:+wYxHMu0Lz0=:PqwCYLgJY3S0JcVg8mI/eA 3opI1Ner6VBWFlt9CxH51fUyYOYW4FFsteotHf3JR17Sj99f6QCk5HVT2wZNXrsDWWk4iPiuV YyINklWjkpDWfvjqEQaOj/U2+U2qwPpBEcGARfvaXwTHS/Y0TGSGmEFfNbq8mRwIkxQDoqi6i MbMHZOGTR/gY4PaEwN3zXV64mS5xhmw9qpbYfGqVk8e4lmMXZnUO3yu0Oqdm7zoxW5H2qT0WN oawFyoqP3pzM/Wt6yLEgarfLQPGBad2ABS7diwGg5b8J5Ao2NXM6mzQfO6pRVHKDmSB2xHFrw m9dMnwXWm1I4fQyjUwYR4iWzQuBh92DbTgnMuNseWiHVqzn6zKovsw0qKueD4WJxCv/4pabyK tIUrjp477PnbyDG7AAL6hn5QJurQIB0gtjfjg/nOLnl0Or0pgOb6PbA6FIRt+BWs0HbarP4Jz BZoNX4uT63lM3crKp6f2g7F5A3uTZ//tFBXsnO31TOEc/urBrXOnrlHdLabdEUTZjAPo3GIPQ 8wulPeY+TfrSTuLFtIvC9EUbU2dhAbt9SuNxUJS1CdbusgBVnyfMbkxoWl8+QCTb9sBdfvxLA 0RYAzK0mpb27LeZRlF1iDJv/EwzPUMsLPWrQL9Ba22/x5JINL50glnV1KnQoWwchAmz5FTdTw BYw3STJUL8Z2Vnq68ksseWfcKiWeXAgEWG1OwPxdQNUuqIFG7WWLlbSNVsH1ubP4f1sxN1diS 6yqhTeF2qbftM3AWpqZdhi8gaTiALoA4e3O1Nn2dzvKiVGQPi04vkTJyZTFH7ottZDEh9i6a X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.78 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:207773 Archived-At: raman writes: > The cl-psetq is the right idiom here in that sense -- if you use plain > setq, you'd have to use a temporary variable? Sure, but I want to avoid to confront people with functions they potentially don't know in these examples, so that they can concentrate on the gist. A minor issue, sure. > Thanks for the coroutine example, again that would do well in the > manual -- there is a reference to coroutines either in the manual or > in code comments in generators.el that is presently "intriguing". AFAIK the original author wanted to add some code for working with coroutines. > Finally, I still dont understand the nested call to iter-yield in the > manual and if it is correct, it would be good to have it better > explained there. I think it is correct (behaves exactly as described, and the behavior is what I expect). What in particular don't you understand? I think the thing that this part wants to demonstrate is that `iter-yield' behaves normally wrt when it is evaluated (function arguments before function calls etc.; so the inner `iter-yield' is called first, and the outer not before the iterator has been restarted). And the outer `iter-yield' yields a value that is computed from the "return value" of the inner, which is the second argument of the according `iter-next' call. Michael.