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 23:09:07 -0500 Message-ID: References: <877fy77zhp.fsf@web.de> <87k326d4ww.fsf@gmail.com> <877fy6rp2o.fsf@web.de> <548230FB.40307@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1417838987 3314 80.91.229.3 (6 Dec 2014 04:09:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Dec 2014 04:09:47 +0000 (UTC) Cc: Michael Heerdegen , emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 06 05:09:39 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 1Xx6gc-0007Gb-7g for ged-emacs-devel@m.gmane.org; Sat, 06 Dec 2014 05:09:38 +0100 Original-Received: from localhost ([::1]:53282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xx6gb-0002jH-JN for ged-emacs-devel@m.gmane.org; Fri, 05 Dec 2014 23:09:37 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xx6gG-0002jA-83 for emacs-devel@gnu.org; Fri, 05 Dec 2014 23:09:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xx6g8-00035J-OZ for emacs-devel@gnu.org; Fri, 05 Dec 2014 23:09:16 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:18046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xx6g8-00035F-KT for emacs-devel@gnu.org; Fri, 05 Dec 2014 23:09:08 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjwPAOwQflRMCqTq/2dsb2JhbABbgweDYIVaxR0EAgKBJBcBAQEBAQF8hAMBAQMBViMFCwsOJhIUGA0kiEoJ1lkBAQEBBgEBAQEeimCGDweESAWLAZIxj3OCCoF4hBkhgncBAQE X-IPAS-Result: AjwPAOwQflRMCqTq/2dsb2JhbABbgweDYIVaxR0EAgKBJBcBAQEBAQF8hAMBAQMBViMFCwsOJhIUGA0kiEoJ1lkBAQEBBgEBAQEeimCGDweESAWLAZIxj3OCCoF4hBkhgncBAQE X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="99691356" Original-Received: from 76-10-164-234.dsl.teksavvy.com (HELO ceviche.home) ([76.10.164.234]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 05 Dec 2014 23:09:08 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id EF90566159; Fri, 5 Dec 2014 23:09:07 -0500 (EST) In-Reply-To: <548230FB.40307@dancol.org> (Daniel Colascione's message of "Fri, 05 Dec 2014 17:26:03 -0500") 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:179084 Archived-At: > Assuming both packages are suitable for inclusion into core, we can > definitely make them work together. That's the idea, yes. > I'd still very much like to use nonlocal control flow instead of > a sentinel for enumeration termination, however. I'll let you guys decide together. I stated my preference, but I have better things to worry about. > That aside, I'm not sure I agree with your namespace preferences. `yield' is > fundamentally a lexically-scoped macro. The lexically scoped `yield' is OK. But the global (defmacro yield ...) is not (tho, I'm OK with keeping it if wrapped in (unless (fboundp 'yield) ...)). > I'd also strongly prefer using `next' as the iter-get function. I know, but this one is out of the question. All globally-visible names need to be namespace-clean. So it can be `gen-next'. > I'd also prefer using `iterating' as the cl-loop keyword. I know, but being globally visible, this is also out of the question: it requires something with a "gen-" or at least some "generator" in its name somewhere. > Because the keyword is only active in the lexical scope of a cl-loop > construct, there's an even lower risk of collision, and the word > "iterating" is exactly the right thing in the cl-loop language: > (cl-loop for x iterating y collect x) reads very well. But it doesn't say we're iterating on your particular kind of iteratable construct. [ BTW: regardless of namespace cleanliness, I don't find "iterating" above to be a good choice, because "x" doesn't "iterate y". The "cl-loop" doesn't do anything else than iterate, so "iterating" is almost necessarily a misnomer in there. From an English language point of view, I'd expect something more like "for x generated-by y" or "for x in-generator y" or "for x in y". ] Stefan