help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: conditionals in elisp


From: Joseph Brenner
Subject: Re: conditionals in elisp
Date: Mon, 02 Nov 2009 11:31:20 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Harry Putnam <reader@newsguy.com> 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
    ...
  )



reply via email to

[Prev in Thread] Current Thread [Next in Thread]