[Top][All Lists]

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

Re: Why is booleanp defined this way?

From: Pascal J. Bourguignon
Subject: Re: Why is booleanp defined this way?
Date: Sat, 18 Apr 2015 05:50:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Rusi <address@hidden> writes:

> Elisp does not have a proper boolean type; unlike say symbols with
> symbolp, strings with stringp, numberp -- some union of numeric types etc.
> However programmers need boolean in their ontology even if (and even more if)
> the language does not support it.

Well, if you go this way, elisp doesn't have proper types at all!!!

deftype, typep, subtypep are all defined in cl.el and as such, "frowned
upon" by the PTB.

> I'd say booleanp is a hesitant step towards supporting boolean in the ontology
> without supporting it in the language.

Let's go boldly where no other elispers has ever gone:

   (deftype boolean () `(member t nil))
   (defun booleanp (x) (typep x 'boolean))

__Pascal Bourguignon__       
“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]