emacs-devel
[Top][All Lists]
Advanced

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

RE: setq's with missing final arguments.


From: Drew Adams
Subject: RE: setq's with missing final arguments.
Date: Sun, 22 Nov 2015 07:52:48 -0800 (PST)

> (defun bad-setq ()
>   "Doc string"
>   (setq foo 5
>       bar))
> In the setq, there is a missing argument after "bar".  At the moment,
> the byte compiler just generates code to assign nil to bar, without
> giving any warning.  IMAO, this is Very Bad.
> I propose to insert code into the byte compiler to detect and warn of
> this scenario:

It's not just the byte-compiler.  This is the (erroneous, IMO)
behavior of `setq', whether interpreted or byte-compiled:

(setq bar) ; bar := nil

(setq bar) should raise an error.  The doc says that `setq'
requires an even number of args.  Same thing in other Lisps
(e.g., Common Lisp).



reply via email to

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