GNU bug report logs - #20241
25.0.50; `setq' with only one argument

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Wed, 1 Apr 2015 14:54:02 UTC

Severity: wishlist

Found in version 25.0.50

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: John Wiegley <jwiegley <at> gmail.com>
Cc: 20241 <at> debbugs.gnu.org, Artur Malabarba <bruce.connor.am <at> gmail.com>
Subject: bug#20241: 25.0.50; `setq' with only one argument
Date: Wed, 25 Nov 2015 20:58:51 +0000
Hello, John.

On Wed, Nov 25, 2015 at 11:40:15AM -0800, John Wiegley wrote:
> >>>>> Artur Malabarba <bruce.connor.am <at> gmail.com> writes:

> > This is a bug then (probably in the advertised-calling-convention of
> > funcall). Functions called with the wrong number of arguments are usually
> > reported as warnings by the byte-compiler.

> Ok, let's go with this then:

>     Evaluation:  Run-time error
>     Compilation: Compile-time warning
>     Execution:   Run-time error (same as Evaluation)

I can live with that.

> I think that's the convergence point for the three of us, amirite?

Things are never that simple.  In evaluation, we now get the signal
"wrong-number-of-args setq 17".  The first eight set operations are not
carried out.

In compilation, currently a warning message (called an "Error") is
emitted, and code is generated to perform 9 set operations (the last one
to nil).  This needs to change.

How about enhancing the definition of setq to say that with 17
arguments, NONE of the assignments are done?  This should be relatively
straight forward to code up in the byte compiler, even in the lexical
binding case.

Or, alternatively, we could explicitly say that whether the first 8
assignments are carried out before signaling the error is undefined.
This should deter over-clever hackers from trying to catch the
wrong-number-of-args error, expecting the code to have done something
predictable.

> John

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 9 years and 238 days ago.

Previous Next


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