[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#13419: make 'eabs' act more like a function
From: |
Paul Eggert |
Subject: |
bug#13419: make 'eabs' act more like a function |
Date: |
Sat, 12 Jan 2013 15:06:37 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 |
On 01/12/2013 05:25 AM, Stefan Monnier wrote:
> Do you really consider this code cleaner?
The implementation's worse, but the use is nicer,
since eabs is guaranteed to evaluate its argument just once.
Anyway, here's a simpler implementation that also evaluates
its argument just once: would you prefer this?
#define eabs(x) imaxabs (x)
(This is shorter and simpler than what's in Emacs now.)
I've attached a complete patch based on this idea.
It incorporates Eli's suggestion to implement imaxabs
via abs rather than labs on 32-bit MS-Windows. (The
idea is to avoid the need to build imaxabs.o on Windows.)
eabs-imaxabs.txt
Description: Text document