emacs-devel
[Top][All Lists]
Advanced

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

Re: Should undefined behavior be encouraged in Emacs?


From: Andreas Röhler
Subject: Re: Should undefined behavior be encouraged in Emacs?
Date: Mon, 03 Oct 2011 10:58:55 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.22) Gecko/20110907 SUSE/3.1.14 Thunderbird/3.1.14

Am 03.10.2011 09:29, schrieb Stephen J. Turnbull:
Andreas Röhler writes:
  >  Am 03.10.2011 05:11, schrieb Stefan Monnier:
  >  >>  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).

  >  my bet: undefined behavior sources bugs, makes maintenance difficult.
  >
  >  Design at the user level certainly deserves a separate approach. It's up
  >  to implement convenient error-handling than rather than undefined behavior.

I don't know about convenient error-*handling*, but if Stefan wants to
prevent people from using the value of primitives called only for
side-effects, he can always provide "convenient error generation" by
having such primitives return Qunbound (or whatever it's called in
Emacs sources: the special uninterned symbol placed in the value slot
of an uninitialized symbol).

;-) ** 100



OK, but when on that side-way, I'm afraid of forms specialising the special case, remove specialising the special case by special condition again and so on.

see all the active-region stuff for a basic example at a basic level.

Andreas




reply via email to

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