From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joseph Brenner Newsgroups: gmane.emacs.help Subject: Re: conditionals in elisp Date: Mon, 02 Nov 2009 11:31:20 -0800 Message-ID: <87eiogzptj.fsf@kzsu.stanford.edu> References: <87iqe1og0i.fsf@newsguy.com> <14A45A8A6D3A42A7ADA56DE8DB68C74E@us.oracle.com> <8763a1o0yx.fsf@newsguy.com> <873a53rij7.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1257190883 10154 80.91.229.12 (2 Nov 2009 19:41:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Nov 2009 19:41:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 02 20:41:16 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 1N52mB-0005Fv-OK for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Nov 2009 20:41:16 +0100 Original-Received: from localhost ([127.0.0.1]:57078 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N52mB-0006Ax-5r for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Nov 2009 14:41:15 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.posted.rawbandwidth!news.posted.rawbandwidth.POSTED!not-for-mail Original-NNTP-Posting-Date: Mon, 02 Nov 2009 13:31:19 -0600 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:MCR4sAYV0N4+Ki+rwnDjYBlEDpo= Original-Lines: 27 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 198.144.208.84 Original-X-Trace: sv3-RoLl8VnR7tgwC5VKvs0qyzO/TxWzLpCU+KEWqAI/YfPZUaH9TD2A2P7P8RhGlBzJ6cFccjcF5twP8a/!0C03xQpSc8mwunbV/Ipsoiz6mFekSRQn21NVPHT/g73nyyd1wjIOfaDv/7b+sXwvKsrc69JfMXE= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Original-Xref: news.stanford.edu gnu.emacs.help:174329 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:69410 Archived-At: Harry Putnam writes: > Oh, and do experts here think that page cited above... in particular > the if/else examples, are good? not so good..? > http://steve-yegge.blogspot.com/2008/01/emergency-elisp.html Yes, they're pretty good, but arguably if you're interested in just writing some working code you should be pointed at "cond" first, which is almost always a better choice than "if". On the other hand, Steve Yegge does a nice job of quickly explaining "progn", a piece of fugliness you need to know if only for the sake of reading existing code. Note, Yegge's article explains "cond" just after "if", in the section titled "switch". He also then talks about "case", bht there the examples aren't complete without a line to load the cl.el package (something like perl's "use"): (require 'cl) (case 12 ... )