[Top][All Lists]

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

Re: Should undefined behavior be encouraged in Emacs?

From: Eli Zaretskii
Subject: Re: Should undefined behavior be encouraged in Emacs?
Date: Mon, 03 Oct 2011 05:52:15 -0400

> Date: Mon, 3 Oct 2011 09:20:46 +0000
> From: Alan Mackenzie <address@hidden>
> Cc: Paul Eggert <address@hidden>, Emacs Development <address@hidden>
> 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:
>  ...
> Surely the return value of things like `goto-char' should be
> defined?

Since this discussion is about to veer sideways, I'd like to make it
clear that I didn't mean something like goto-char's return value at
all.  What I meant is the behavior of Lisp primitives and subroutines
when they are called with invalid arguments, such as buffer positions
that are non-positive.

The original example was that an overlay was moved to start at
position zero and end on position 1, and Paul wanted such an overlay
to be considered empty, because he _expected_ position zero to be
always treated as position 1.

reply via email to

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