[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Should mode commands be idempotent?
From: |
Drew Adams |
Subject: |
RE: Should mode commands be idempotent? |
Date: |
Tue, 19 Sep 2017 15:58:23 -0700 (PDT) |
> I think it's generally expected that mode commands (both major and
> minor) are reasonably idempotent, i.e. calling them twice should
> have the same effects as calling them once (unless using 'toggle,
> of course). However, I couldn't find this requirement in the manual,
> should it be added to the "Modes" section?
It is perhaps typical; i.e., perhaps most modes have that
property. But I don't see why it "should" be true of modes.
Why should it be a "requirement" or a convention?
People can use a mode for whatever they want. A mode can
do anything its author wants it to do. I see that as a
good thing, not a bad thing.
What's the use case for such a restriction? If it's to
allow for easier program analysis or something, it should
be enough to let people know (if appropriate) that if a
mode is not idempotent then it might be more difficult to
reason about its behavior. (But reasoning about Lisp
behavior is anyway not something simple - Lisp is not
Haskell.)
The fact that most modes are likely idempotent should be
enough, I think. Most mode writers don't go out of their
way to make a mode act differently if it is turned on more
than once.
- Re: Should mode commands be idempotent?, (continued)
- Re: Should mode commands be idempotent?, Clément Pit-Claudel, 2017/09/19
- Re: Should mode commands be idempotent?, Stefan Monnier, 2017/09/20
- Re: Should mode commands be idempotent?, Clément Pit-Claudel, 2017/09/23
- Re: Should mode commands be idempotent?, Stefan Monnier, 2017/09/23
- Re: Should mode commands be idempotent?, Stefan Monnier, 2017/09/23
RE: Should mode commands be idempotent?,
Drew Adams <=
- Re: Should mode commands be idempotent?, Stefan Monnier, 2017/09/19
- RE: Should mode commands be idempotent?, Drew Adams, 2017/09/20
- Re: Should mode commands be idempotent?, Stefan Monnier, 2017/09/20
- RE: Should mode commands be idempotent?, Drew Adams, 2017/09/21
- Re: Should mode commands be idempotent?, Richard Stallman, 2017/09/21
- RE: Should mode commands be idempotent?, Drew Adams, 2017/09/22
- Re: Should mode commands be idempotent?, Richard Stallman, 2017/09/22
- RE: Should mode commands be idempotent?, Drew Adams, 2017/09/24
- Re: Should mode commands be idempotent?, Richard Stallman, 2017/09/25
Re: Should mode commands be idempotent?, Clément Pit-Claudel, 2017/09/23