44127Re: minor feature request: let!
- Jul 2 2:16 PMOn 7/2/06, Yakov Lerner <iler.ml@...> wrote:
> On 7/2/06, Mikolaj Machowski <mikmach@...> wrote:And in any case, setting an option using let is very different from
> > Dnia niedziela, 2 lipca 2006 12:06, Nikolai Weibull napisał:
> > > On 7/1/06, justin constantino <goflyapig@...> wrote:
> > > > E706: Variable type mismatch
> > > >
> > > > As a minor improvement, I think it would be nice if you could do:
> > > >
> > > > let foo = "one,two,three"
> > > > let! foo = split(foo, ',')
> > >
> > > I think we should just remove the whole restriction.
> > >
> > Definitely not. I was thinking about suggestion of :let! few times before
> > and each time I was throwing it away. For example :let allows to change
> > settings. Silently dropping changing of option value or setting it to
> > some absurd setting would be Bad Thing(tm).
> I'd like to see how current :let is so super-intelligent
> so that it prevents assignment of what you call "absurd setting"
> to the &options.
> Consider string-to-number assignment rules.
> :let &readonly="abc" " silently allowed
> :let &shiftwidth="xyz" " silently allowed
> :let &statusline=123 " silently allowed
setting a user variable to a value.
This is a case of "Trying Too Hard".
When exactly does this prevent you from making an error?
It's only valid for options, and they have very different semantics
from user variables. So just drop the check and allow people to reuse
their variables if they like.
- << Previous post in topic Next post in topic >>