[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Should undefined behavior be encouraged in Emacs?
From: |
Alan Mackenzie |
Subject: |
Re: Should undefined behavior be encouraged in Emacs? |
Date: |
Mon, 3 Oct 2011 09:20:46 +0000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi, Stefan.
On Sun, Oct 02, 2011 at 11:11:58PM -0400, Stefan Monnier wrote:
> > The argument given for undefined behavior is that it simplifies
> > maintenance of Emacs internals.
> I like to keep some corner of the behavior undefined, when I think
> that user code that depends on such details is undesirable (e.g. return
> values of primitives which are only called for side-effects).
There are few functions called solely for side effects. For example,
`goto-char' is frequently found thusly:
(and
...
...
(goto-char anchor-point)
...
...)
. Strictly speaking this behaviour is undefined because the return
value (which everybody knows to be anchor-point) is undefined. Strictly
speaking, one has to write it like this:
(and
...
...
(progn (goto-char anchor-point) t)
...
...)
, which is a pain in the alist. Surely the return value of things like
`goto-char' should be defined?
> Stefan
--
Alan Mackenzie (Nuremberg, Germany).
- Re: Should undefined behavior be encouraged in Emacs?, (continued)
- Re: Should undefined behavior be encouraged in Emacs?, Alan Mackenzie, 2011/10/07
- Re: Should undefined behavior be encouraged in Emacs?, Barry Warsaw, 2011/10/07
- Re: Should undefined behavior be encouraged in Emacs?, ken manheimer, 2011/10/07
- Re: Should undefined behavior be encouraged in Emacs?, Barry Warsaw, 2011/10/07
- Re: Should undefined behavior be encouraged in Emacs?, Óscar Fuentes, 2011/10/07
- Re: Should undefined behavior be encouraged in Emacs?, ken manheimer, 2011/10/07
- RE: Should undefined behavior be encouraged in Emacs?, Drew Adams, 2011/10/07
- Re: Should undefined behavior be encouraged in Emacs?, Miles Bader, 2011/10/08
- RE: Should undefined behavior be encouraged in Emacs?, Drew Adams, 2011/10/08
- Re: Should undefined behavior be encouraged in Emacs?, Stefan Monnier, 2011/10/03
Re: Should undefined behavior be encouraged in Emacs?,
Alan Mackenzie <=
Re: Should undefined behavior be encouraged in Emacs?, Andreas Schwab, 2011/10/03
Re: Should undefined behavior be encouraged in Emacs?, Richard Stallman, 2011/10/03
Re: Should undefined behavior be encouraged in Emacs?, Eli Zaretskii, 2011/10/03