GNU bug report logs - #13419
make 'eabs' act more like a function

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Sat, 12 Jan 2013 06:51:01 UTC

Severity: minor

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 13419 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 13419 <at> debbugs.gnu.org
Subject: Re: bug#13419: make 'eabs' act more like a function
Date: Sat, 12 Jan 2013 15:06:37 -0800
[Message part 1 (text/plain, inline)]
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 (text/plain, attachment)]

This bug report was last modified 12 years and 209 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.