From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: Adding assoc-delete-all / rassoc-delete-all Date: Thu, 17 Apr 2014 14:35:27 +0200 Message-ID: <8738hcjfqo.fsf@gnu.org> References: <87a9bkjibm.fsf@gnu.org> <87ioq8dvau.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1397738199 5062 80.91.229.3 (17 Apr 2014 12:36:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Apr 2014 12:36:39 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thorsten Jolitz Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 17 14:36:32 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 1WalYN-0006GD-Lb for ged-emacs-devel@m.gmane.org; Thu, 17 Apr 2014 14:36:31 +0200 Original-Received: from localhost ([::1]:60571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WalYN-0002EK-8d for ged-emacs-devel@m.gmane.org; Thu, 17 Apr 2014 08:36:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WalYD-0001mn-9x for emacs-devel@gnu.org; Thu, 17 Apr 2014 08:36:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WalY5-0006Hy-Rk for emacs-devel@gnu.org; Thu, 17 Apr 2014 08:36:21 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:34239) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WalY5-0006Hl-Lh for emacs-devel@gnu.org; Thu, 17 Apr 2014 08:36:13 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 8BB471A8454; Thu, 17 Apr 2014 14:36:12 +0200 (CEST) X-Virus-Scanned: amavisd-new at uni-koblenz.de Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YxlPFgjARvSz; Thu, 17 Apr 2014 14:36:12 +0200 (CEST) X-CHKRCPT: Envelopesender noch tsdh@gnu.org Original-Received: from thinkpad-t440p (dhcp84.uni-koblenz.de [141.26.71.84]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 36DD71A8451; Thu, 17 Apr 2014 14:36:12 +0200 (CEST) Mail-Followup-To: Thorsten Jolitz , emacs-devel@gnu.org In-Reply-To: <87ioq8dvau.fsf@gmail.com> (Thorsten Jolitz's message of "Thu, 17 Apr 2014 13:55:53 +0200") User-Agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 141.26.64.15 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:171467 Archived-At: Thorsten Jolitz writes: > Reminds me of the many times I wished there would be a > > ,-------------------------------------------------------- > | case is an alias for `cl-case' in `cl.el'. > | > | (case EXPR (KEYLIST BODY...)...) > | > | Eval EXPR and choose among clauses on that value. [...] > | Key values are compared by `eql'. > `-------------------------------------------------------- Strange that it compares with `eql'. Doesn't `eql' only allow comparing floating point values in addition to what's allowed by `eq'? And floats don't seem to be reasonable candidates for a `case' distinction... > that does comparison with `equal' too (or does it exist and I just > missed it?). No, I don't think there is. But I think here a more versatile macro would be better than hard-coding another version with the test fixed to `equal' [1]. For example, Clojure has `condp' which is similar to `case' but allows to specify the predicate. (condp #'equal x "Foo" :foo 1 :one 17 :seventeen :neither-foo-one-or-seventeen) Bye, Tassilo [1] That's a bit different for `assoc-delete-all' because the names `assq' and `assoc' are traditionally associated with `eq' and `equal'.