Loading ...
Sorry, an error occurred while loading the content.

44121Re: minor feature request: let!

Expand Messages
  • Yakov Lerner
    Jul 2 12:27 PM
    • 0 Attachment
      On 7/2/06, Mikolaj Machowski <mikmach@...> wrote:
      > 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
      Just normal silent string-to-nubmer (and number to string,
      whre applicable) conversion well-accepted in interpreted languages.
      Where did you see the "intelligent prevention of absurd values"
      in the existing :let ? If anything, it's boolean and numeric
      nature of some options that forces corresponsing conversion, or
      string nature of the other options.

      It forces :let into silent type conversion, right now.
      This is exactly what prompred Justin and Nikolai to ask for
      analogous silent type conversion between lists and strings.

    • Show all 10 messages in this topic