On 2006-04-30, Yakov Lerner <[EMAIL PROTECTED]> wrote:
> On 4/30/06, Gerald Lai <[EMAIL PROTECTED]> wrote:
> > The 'compatible' option is one that clobbers settings, but for a good
> > reason. It determines whether Vim should work like Vi, or take on the
> > modern Vim capabilities. It's a big switch.
>
> It's only a switch if 'nocp' was off and becomes on. If option
> X has value Y and I do 'set X=Y' I expect it to be noop, except maybe
> screen refresh. When option had different value, and I change it's
> value, then I agree it's a switch.
If setting an option has a side-effect, I generally expect that
side-effect to occur whenever I set the option. If an option X has
a value Y, and I know this, I have no reason to "set X=Y" unless I
want the side-effect to happen. If I don't know the current value
of X, I expect "set X=Y" to to behave consistently and not in a
manner dependent on its current value. That's following the
principle of least surprise.
Further, if I don't like that behavior and want "set X=Y" to be a
no-op if X already equals Y, I can work around that with something
like
if X != Y
set X=Y
endif
I can't work around the other behavior without setting X to some
value not equal Y, which may have side-effects I want to avoid.
Gary
--
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Wireless Division
| Spokane, Washington, USA