From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.help Subject: Re: Wanted: mapcar() without nils Date: Sat, 13 Jun 2009 21:43:28 +0200 Message-ID: References: <65652541-cb7d-4c93-8baf-cd963990e57e@g1g2000yqh.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1244922248 17543 80.91.229.12 (13 Jun 2009 19:44:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Jun 2009 19:44:08 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?UTF-8?B?Tm9yZGzDtnc=?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 13 21:44:05 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MFZ93-00054o-AQ for geh-help-gnu-emacs@m.gmane.org; Sat, 13 Jun 2009 21:44:05 +0200 Original-Received: from localhost ([127.0.0.1]:33681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MFZ92-0003Dk-2A for geh-help-gnu-emacs@m.gmane.org; Sat, 13 Jun 2009 15:44:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MFZ8Z-0003Az-7o for help-gnu-emacs@gnu.org; Sat, 13 Jun 2009 15:43:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MFZ8U-00033k-AV for help-gnu-emacs@gnu.org; Sat, 13 Jun 2009 15:43:34 -0400 Original-Received: from [199.232.76.173] (port=55272 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MFZ8U-00033U-3T for help-gnu-emacs@gnu.org; Sat, 13 Jun 2009 15:43:30 -0400 Original-Received: from mail-fx0-f217.google.com ([209.85.220.217]:53970) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MFZ8T-0007RF-PA for help-gnu-emacs@gnu.org; Sat, 13 Jun 2009 15:43:29 -0400 Original-Received: by fxm17 with SMTP id 17so4382376fxm.42 for ; Sat, 13 Jun 2009 12:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=11zh5S5QF39CQcKBV54cTmtej9SfMG3SNRWKTvP5Yvs=; b=dqATj5atGhlxjToOtstLcvbx8uvLjbAb5vKkv0PEsY2CIh3UzeSnqXt1ea8EHFJhbh ezSyBdHZQPJa5Yox1S+16/ijJPRZ4AvHd2xo94TtvFugSTToOftTGf4m+HbmQu5KH6HN msLaM1+2fyQAETPdJCqdbxhmjTLLlxbQNv89Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=rBISXYicOkTB7CaThX/RcvoxyZnTYyGs/9mgBQOUXXdwrQAyy3GgDsnbz2TJndfeUx omUCWlzOapQgx1iB6bl4I8q8v8/YDHLKu1I5Um2XJgFIP7zIhAz+WSEjXMGTgJhWzM27 a6driFxQbtRd6BqP+E3B8Xkj3Bc0aF+70l6HY= Original-Received: by 10.239.179.141 with SMTP id d13mr409905hbg.124.1244922208863; Sat, 13 Jun 2009 12:43:28 -0700 (PDT) In-Reply-To: <65652541-cb7d-4c93-8baf-cd963990e57e@g1g2000yqh.googlegroups.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:65264 Archived-At: You misplaced a closing paren in the lambda On Sat, Jun 13, 2009 at 8:24 PM, Nordl=C3=B6w wrote: > (defun extract-elements (pred seq) > =C2=A0"Extract a copy of SEQ containing all elements fullfilling > PRED." > =C2=A0(delq nil (mapcar `(lambda (elm) (when (,pred elm)) elm) seq))) (delq nil (mapcar `(lambda (elm) (when (,pred elm) elm)) seq))) > ;; Use: (extract-elements 'symbolp '(a b 1 2)) =3D> '(a b) > ;; Use: (extract-elements 'numberp '(a b 1 2)) =3D> '(1 2)