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

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

Re: An elisp question


From: Joost Kremers
Subject: Re: An elisp question
Date: 17 Sep 2008 21:05:00 GMT
User-agent: slrn/0.9.8.1 (Linux)

Oleksandr Gavenko wrote:
> In elisp.html (edition 2.8) on "20.6 Yes-or-No Queries" also there no 
> special warning about use of "Yes-or-No".

the point is that Y-OR-N-P returns either t or nil, so you don't need to
explicitly compare it to T, you can just use it directly as the test for
IF. you wrote:

(if (equal (y-or-n-p "Yes or no? ") t)
    ...

but it's more concise to write:

(if (y-or-n-p "Yes or no? ")
    ...

(btw, if you want to test if a value is t, you can use eq, there's no need
to use equal.)


-- 
Joost Kremers                                      joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


reply via email to

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