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

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

Re: Why is booleanp defined this way?


From: Marcin Borkowski
Subject: Re: Why is booleanp defined this way?
Date: Sat, 18 Apr 2015 09:44:46 +0200

Hi all,

I love how I inadvertently start these huge threads...  Really, I didn't
mean it!

On 2015-04-18, at 03:06, Emanuel Berg <embe8573@student.uu.se> wrote:

> "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))

Fascinating.  Really, I'm serious.

>
> ... 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 :)

I love to break it to you, but the C64 demoscene seems to be alive and
kicking.

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



reply via email to

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