[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why is booleanp defined this way?
From: |
Emanuel Berg |
Subject: |
Re: Why is booleanp defined this way? |
Date: |
Sat, 18 Apr 2015 03:06:02 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
"Pascal J. Bourguignon" <pjb@informatimago.com>
writes:
> You may want to compare:
>
> (defun normalize-boolean (obj)
> (if obj t))
> (disassemble (byte-compile 'normalize-boolean))
> byte code:
> args: (obj)
> 0 varref obj
> 1 goto-if-nil-else-pop 1
> 4 constant t
> 5:1 return
>
> with:
>
> (defun g (x) (not (not x)))
> byte code:
> args: (x)
> 0 varref x
> 1 not
> 2 not
> 3 return
>
> (disassemble (byte-compile 'f))
... you mean 'g?
Are you saying (not (not x)) generates more efficient
byte-code? I hate to break it to you, but the
Commodore 64 demo era is long gone :)
>> So I think `booleanp' shouldn't be thought of as
>> a normalizer but rather as a type predicate, much
>> like them `stringp', `integerp', and so on.
>
> Of course. That's what the "p" in "booleanp" means!
If that is "of course" then what are we talking about?
--
underground experts united
http://user.it.uu.se/~embe8573
- Why is booleanp defined this way?, Marcin Borkowski, 2015/04/17
- Re: Why is booleanp defined this way?, Jorge A. Alfaro-Murillo, 2015/04/17
- Message not available
- Re: Why is booleanp defined this way?, Emanuel Berg, 2015/04/17
- Re: Why is booleanp defined this way?, Pascal J. Bourguignon, 2015/04/17
- Re: Why is booleanp defined this way?,
Emanuel Berg <=
- Re: Why is booleanp defined this way?, Pascal J. Bourguignon, 2015/04/17
- Re: Why is booleanp defined this way?, Marcin Borkowski, 2015/04/18
- Re: Why is booleanp defined this way?, Stefan Nobis, 2015/04/18
- Re: Why is booleanp defined this way?, Emanuel Berg, 2015/04/19
RE: Why is booleanp defined this way?, Drew Adams, 2015/04/17
Re: Why is booleanp defined this way?, Tassilo Horn, 2015/04/18