From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Brockman Newsgroups: gmane.emacs.devel Subject: Re: constant `e' Date: Sat, 10 Feb 2007 12:35:30 +0100 Message-ID: <87y7n6fdod.fsf@wigwam.brockman.se> References: <87ireah6ia.fsf@wigwam.brockman.se> <854ppu8k1l.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1171107355 17925 80.91.229.12 (10 Feb 2007 11:35:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 10 Feb 2007 11:35:55 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 10 12:35:49 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HFqWB-0000Fj-St for ged-emacs-devel@m.gmane.org; Sat, 10 Feb 2007 12:35:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HFqWB-0005Rp-EG for ged-emacs-devel@m.gmane.org; Sat, 10 Feb 2007 06:35:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HFqVw-0005Qo-SE for emacs-devel@gnu.org; Sat, 10 Feb 2007 06:35:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HFqVv-0005PL-8W for emacs-devel@gnu.org; Sat, 10 Feb 2007 06:35:31 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HFqVu-0005P0-9Z for emacs-devel@gnu.org; Sat, 10 Feb 2007 06:35:30 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HFqVt-0008Ai-RA for emacs-devel@gnu.org; Sat, 10 Feb 2007 06:35:30 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HFqVg-0004Xn-Vk for emacs-devel@gnu.org; Sat, 10 Feb 2007 12:35:17 +0100 Original-Received: from c-a4fee255.09-32-6c6b7013.cust.bredbandsbolaget.se ([85.226.254.164]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Feb 2007 12:35:16 +0100 Original-Received: from daniel by c-a4fee255.09-32-6c6b7013.cust.bredbandsbolaget.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Feb 2007 12:35:16 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 79 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: c-a4fee255.09-32-6c6b7013.cust.bredbandsbolaget.se X-Face: :&2UWGm>e24)ip~'K@iOsA&JT3JX*v@1-#L)=dUb825\Fwg#`^N!Y*g-TqdS AevzjFJe96f@V'ya8${57/T'"mTd`1o{TGYhHnVucLq!D$r2O{IN)7>.0op_Y`%r;/Q +(]`3F-t10N7NF\.Mm0q}p1:%iqTi:5]1E]rDF)R$9.!,Eu'9K':y9^U3F8UCS1M+A$ 8[[[WT^`$P[vu>P+8]aQMh9giu&fPCqLW2FSsGs User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.51 (gnu/linux) Cancel-Lock: sha1:QUeFDdJnLWgr+RVPv2Ed85pbvaE= X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:66208 Archived-At: David Kastrup writes: > Daniel Brockman writes: > >> Seriously, though, I'd really like to see an `otherwise' >> constant (defined to `t', of course). That would make >> catch-all clauses of `cond' look much better. > > Disagree, that's an idiom. Of course it's an idiom. That doesn't mean it looks good. I, as a speaker of Emacs Lisp, would prefer not to use this idiom if `otherwise' became an accepted alternative. Why? Because I simply think this looks ugly: (cond ((not (null n)) (bongo-mark-line-forward (prefix-numeric-value n))) ((bongo-region-active-p) (bongo-mark-region (region-beginning) (region-end))) (t (bongo-mark-line-forward))) It looks as if the last arm is about to break and fall off. I think this looks better: (cond ((not (null n)) (bongo-mark-line-forward (prefix-numeric-value n))) ((bongo-region-active-p) (bongo-mark-region (region-beginning) (region-end))) (otherwise (bongo-mark-line-forward))) Incidentally, I also think `(not (null n))' looks better than `n' --- as do, I believe, most Emacs Lisp programmers. Take a look at this code: (cond (n (bongo-mark-line-forward (prefix-numeric-value n))) ((bongo-region-active-p) (bongo-mark-region (region-beginning) (region-end))) (t (bongo-mark-line-forward))) It's ugly, isn't it? It's not just that `(not (null n))' is semantically clearer than a lone `n'; it's also more beautiful. > Anyway, you can do > > (cond ((eq x 'yellow) "yellow") > ((eq x 'green) "green") > ("other")) > > and avoid the t altogether. Not that it is prettier to > my eyes. Interesting. I think I'll try that for a while. (cond ((not (null n)) (bongo-mark-line-forward (prefix-numeric-value n))) ((bongo-region-active-p) (bongo-mark-region (region-beginning) (region-end))) ((bongo-mark-line-forward))) It looks a little weird, but maybe I'll get used to it. It certainly is prettier to my eyes. Thanks. >> Please? > > There is no point in Elisp diverging from Lisp without > more compelling reasons. The `case' macro already allows `otherwise'. That's a pretty compelling reason to allow it in `cond' as well. (Yes, I know `case' is in the `cl' library, but lots of people use that library --- at least its macros.) -- Daniel Brockman