From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wolfgang Jenkner Newsgroups: gmane.emacs.devel Subject: Re: New version of todo-mode.el (announcement + user guide) Date: Wed, 12 Jun 2013 20:30:45 +0200 Message-ID: <854nd32mz4.fsf@inode.at> References: <87k3m2275u.fsf@rosalinde.fritz.box> <8761xmxfnx.fsf@bzg.ath.cx> <87txl6ghjq.fsf@rosalinde.fritz.box> <87a9myggr7.fsf@wanadoo.es> <87sj0p8z99.fsf@rosalinde.fritz.box> <87mwqwpk98.fsf@rosalinde.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1371062374 27358 80.91.229.3 (12 Jun 2013 18:39:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Jun 2013 18:39:34 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Stephen Berman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 12 20:39:34 2013 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 1Umpx9-0002et-VW for ged-emacs-devel@m.gmane.org; Wed, 12 Jun 2013 20:39:28 +0200 Original-Received: from localhost ([::1]:40119 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Umpx9-0006V3-Im for ged-emacs-devel@m.gmane.org; Wed, 12 Jun 2013 14:39:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Umpx6-0006U9-Jb for emacs-devel@gnu.org; Wed, 12 Jun 2013 14:39:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Umpx5-0004uz-I5 for emacs-devel@gnu.org; Wed, 12 Jun 2013 14:39:24 -0400 Original-Received: from mx18.lb01.inode.at ([62.99.145.20]:15184 helo=mx.inode.at) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Umpx5-0004u9-B9 for emacs-devel@gnu.org; Wed, 12 Jun 2013 14:39:23 -0400 Original-Received: from [91.119.88.127] (port=15201 helo=localhost) by smartmx-18.inode.at with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Umpx1-0004ml-FN; Wed, 12 Jun 2013 20:39:19 +0200 Original-Received: from wolfgang by localhost with local (Exim 4.80.1) (envelope-from ) id 1UmpwN-00089e-Fx; Wed, 12 Jun 2013 20:38:39 +0200 Mail-Followup-To: Stephen Berman , Stefan Monnier , emacs-devel@gnu.org User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 62.99.145.20 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:160384 Archived-At: On Tue, Jun 11 2013, Stephen Berman wrote: > - The code makes use of a powerset function, which Emacs doesn't have. > I tried but couldn't come up with my own algorithm but found a > recursive Common Lisp implementation and an iterative one in C The straightforward recursive implementation can be rewritten as an iterative one by conceptually doing left- instead of right-folding. (defun my-powerset (list) "Return the powerset of LIST." (let ((powerset (list nil))) (dolist (elt list (mapcar 'reverse powerset)) (nconc powerset (mapcar (apply-partially 'cons elt) powerset))))) Here are some other (more or less serious) variations on the theme: https://groups.google.com/forum/?fromgroups#!topic/comp.lang.lisp/gxWw9x3TvAI Wolfgang