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: Generators (iterators) for Gnu Emacs Date: Fri, 05 Dec 2014 09:40:33 -0500 Message-ID: References: <877fy77zhp.fsf@web.de> <87lhmm24x9.fsf@gmail.com> <54812545.6030008@dancol.org> <87d27y22lp.fsf@gmail.com> <87lhmmiim7.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1417790471 10789 80.91.229.3 (5 Dec 2014 14:41:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Dec 2014 14:41:11 +0000 (UTC) Cc: emacs-devel@gnu.org To: Leo Liu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 05 15:41:05 2014 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 1Xwu49-0000uQ-8W for ged-emacs-devel@m.gmane.org; Fri, 05 Dec 2014 15:41:05 +0100 Original-Received: from localhost ([::1]:50735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xwu48-0004mc-Pk for ged-emacs-devel@m.gmane.org; Fri, 05 Dec 2014 09:41:04 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xwu3k-0004mG-LT for emacs-devel@gnu.org; Fri, 05 Dec 2014 09:40:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xwu3e-0003ox-GH for emacs-devel@gnu.org; Fri, 05 Dec 2014 09:40:40 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:6691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xwu3e-0003os-CP for emacs-devel@gnu.org; Fri, 05 Dec 2014 09:40:34 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkIPAOwQflRMCqTq/2dsb2JhbABbgwdSgw6FWr8EhhkEAgKBJBcBAQEBAQF8hAMBAQMBViMFCwsOJhIUGA0kiEoJDdZMAQEBAQEBBAEBAQEBGQSQbweESAWLAYoemhCBeIQZIYJ3AQEB X-IPAS-Result: AkIPAOwQflRMCqTq/2dsb2JhbABbgwdSgw6FWr8EhhkEAgKBJBcBAQEBAQF8hAMBAQMBViMFCwsOJhIUGA0kiEoJDdZMAQEBAQEBBAEBAQEBGQSQbweESAWLAYoemhCBeIQZIYJ3AQEB X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="99635955" Original-Received: from 76-10-164-234.dsl.teksavvy.com (HELO pastel.home) ([76.10.164.234]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 05 Dec 2014 09:40:33 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 7C0A387F8; Fri, 5 Dec 2014 09:40:33 -0500 (EST) In-Reply-To: <87lhmmiim7.fsf@gmail.com> (Leo Liu's message of "Fri, 05 Dec 2014 16:52:16 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:178926 Archived-At: > No. Daniel's package https://github.com/dcolascione/elisp-generators. > Do you have time to critique the code and make it an integral part of > elisp? Thanks ;) I haven't had time to look at it in detail, but it looks nice. Things I noticed: - Drop the use of (require 'cl). - Use `declare' for indentation and edebug specs. - Most importantly: clean up the namespace use. `yield' is probably OK (tho the global definition should probably not override a previous definition) but `next' needs to turn into something like `gen-next', `do-iterator' should probably turn into `gen-do', cl-loop's `iterating' should probably turn into something that includes "generator" in its name, `lambda-generator' should maybe be renamed to `gen-lambda', ... Once that's fixed, I'd be happy to see it included in Emacs. Stefan