From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: Generators (iterators) for Gnu Emacs Date: Fri, 05 Dec 2014 17:08:26 -0500 Message-ID: <54822CDA.7060604@dancol.org> References: <877fy77zhp.fsf@web.de> <87lhmm24x9.fsf@gmail.com> <54812545.6030008@dancol.org> <87d27y22lp.fsf@gmail.com> <87lhmmiim7.fsf@gmail.com> <5481D080.7000206@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Drt7novopadlP7xpgf2l76vqEUsDnaNWt" X-Trace: ger.gmane.org 1417817360 13793 80.91.229.3 (5 Dec 2014 22:09:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Dec 2014 22:09:20 +0000 (UTC) Cc: Leo Liu , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 05 23:09:14 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 1Xx13p-0006My-Pe for ged-emacs-devel@m.gmane.org; Fri, 05 Dec 2014 23:09:13 +0100 Original-Received: from localhost ([::1]:52631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xx13p-00044I-5F for ged-emacs-devel@m.gmane.org; Fri, 05 Dec 2014 17:09:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xx13G-00040X-2e for emacs-devel@gnu.org; Fri, 05 Dec 2014 17:08:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xx13E-0004pq-Bj for emacs-devel@gnu.org; Fri, 05 Dec 2014 17:08:37 -0500 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:40093) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xx13D-0004oc-Ux for emacs-devel@gnu.org; Fri, 05 Dec 2014 17:08:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=72lhY/axenrO1h3Ajedri3aU8ybWUuydoqB93kitrsM=; b=p6fVODPa41J56pk4cqO7f8esUI6wEzzg/MczFuoJnV77ObzKTzBvyKXx9YJ65CJrUQmeHvWhKTtNjewGN6ZqNjcXJAAeJ6kSDMggAcQatt4jdLVbRpxroDZslDgGSVoxRo/XkFMZP186PdCFcXTMeplnODPrvA8TKohYZ9oIOiFU3+zdMiZz1gEdwMyF2Qy8EG7E1OWJom+FYj38QUwN0Q0+U9y6iXVoixXo5YUmnZ7ZmiBSVB5ANUiK7zaIeW6z1J3VVEMMlBQDvSRk+uoMPDU32Y7AZFg4P0MOv0yAmG4ClI5nlI6mvjVOWBzgUe2sdNKFwZeBm4Xqxecsl0XA0Q==; Original-Received: from [2620:10d:c0a3:1003:2ab2:bdff:fe1c:db58] by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1Xx13B-0007V0-CV; Fri, 05 Dec 2014 14:08:33 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 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:179033 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Drt7novopadlP7xpgf2l76vqEUsDnaNWt Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 12/05/2014 01:32 PM, Stefan Monnier wrote: >> I'd really rather signal to stop iteration. That way, it's harder to i= gnore >> end-of-iteration and loop forever and it remains possible to iterate o= ver >> *any* value. condition-case is setjmp. I'm not *that* concerned by >> performance. The only other reasonable alternative is for iterators to= >> yield a cons (terminal-p . value), and consing is going to be much wor= se >> than condition-case. >=20 > The alternative I was thinking was to return a unique value, as in: >=20 > (defvar gen-eog (make-symbol "=A1end-of-generator!")) > (defun gen-eog-p (x) (eq x gen-oeg)) >=20 Right. That's the approach I don't like: now there's a value you can't en= umerate. What if you wanted to enumerate, say, the values of all symbols?= =09 --Drt7novopadlP7xpgf2l76vqEUsDnaNWt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJUgizaAAoJEN4WImmbpWBlDP4QAJCCI2oBO63DwFNwE+bEhpTA iDjtwFFcAXCeDVPVyf/C+7APipPkUzIU54RkJZ3/kgvMaglpmw1wTiEmqQr+Tf0t iK3eYSARAh6odo8F7WXNYTZmILQ0lvCdQji8K0VFVhtFE1ojgKjjQoeps5o0CaHZ 4YA7LNeZch0cTjTG8yDwNlOqJ6hmNC2CeyhBkrislg+Fdo55kYmZZWR2UHAZFyAL WHo1zLoQW9xKBD29s4dGiZbKX+aT8NqjV5dCZO64uLR1jJs5/Kx0A2CpSQ9360G9 i2PkvzWnGbXFcM393pJtcmdwelja91qr/Lx072mnVipp8aivt3xdWFGNK222hZXv JO/SN68Zqyt5zGjJ8m+LbHittS5pwQiAPzhvFpYdd13xoAISsdsuyUL+yEz23GXn ko7r0shsgDoB/6m89yM5g64Nbl0/sZfuHFK3QeCk1MfkbYpE5o71nXWQ/61VRj/G Sm3SZ40821Ow+ZODRisBkChdp8cnPDf0BgOylWudLUV7FNOCgjSIrCB3dcQdLkxA OBaN/LFIAi1RQk0DfZ0GKKmpeDtl7BQXZvSyQkfzBRBc5WgmVb8d87D/StQYObxN svxx8sdyKNfNFexEiIT0OoIC6FsU1brySPyuhwsLRtzwCBZYGdrbAYb8rAms1rny pBWIv9jXQnmxmq0jz+1m =Jp3h -----END PGP SIGNATURE----- --Drt7novopadlP7xpgf2l76vqEUsDnaNWt--