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

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

Re: predicates


From: Pascal J. Bourguignon
Subject: Re: predicates
Date: Fri, 27 Nov 2015 05:28:54 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Emanuel Berg <embe8573@student.uu.se> writes:

> Alex Bennée <alex.bennee@linaro.org> writes:
>
>> It's a predicate, giving a true/false response.
>
> This is how I understand it:
>
> In practice predicates can return anything.
>
> nil, and the empty list, should be interpreted as *false*.

They return a generalized boolean, which can indeed be anything.

> Computers are deterministic but that doesn't mean they
> are consistent.

One notable predicate that returns something useful not obtainable
otherwise, is:
              
   (digit-char-p ?4) --> 4

You could use: 
 
    (ignore-errors (parse-integer (string ?4))) --> 4

but parse-integer uses digit-char-p which is the more fundamental
operation.

-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


reply via email to

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