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

Re: Curly brace expansion oddity (was "How to clear number registers")

Expand Messages
  • Christian Brabandt
    Hi Bram, ... Attached patch fixes it regards, Christian -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the
    Message 1 of 2 , Mar 5, 2012
    • 0 Attachment
      Hi Bram,

      On So, 04 Mär 2012, Tim Chase wrote:

      > On 03/04/12 00:49, Paul Isambert wrote:
      > >howard Schwartz<howardb21@...> a écrit:
      > >>au BufRead * for i in range(1,9) | let @i = "" | endfor
      > >
      > >You should use ":exe[cute]":
      > >
      > > au BufRead * for i in range(1,9) | exe "let @" . i . " = ''" | endfor
      >
      >
      > In attempting to answer for this, I reached for
      > curly-braces-expansion but discovered it didn't work as expected:
      >
      > :let i=3
      > :let @{i}=''
      > :echo @{i}
      >
      > returned an E18 (on the let) and an E15 (on the echo). If I issue
      >
      > :let i=3
      > :let x{i}=42
      > :echo x3
      >
      > it works as expected. Reading up at
      >
      > :help curly-braces-names
      >
      > doesn't give me much insight. Any takers to tell me it's a bug or
      > point out my misunderstanding?

      Attached patch fixes it


      regards,
      Christian

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Bram Moolenaar
      ... Well, it supports the curly-braces notation in a two more places. But I prefer to not further develop curly braces. It works with the :execute solution,
      Message 2 of 2 , Mar 7, 2012
      • 0 Attachment
        Christian Brabandt wrote:

        > On So, 04 Mär 2012, Tim Chase wrote:
        >
        > > On 03/04/12 00:49, Paul Isambert wrote:
        > > >howard Schwartz<howardb21@...> a écrit:
        > > >>au BufRead * for i in range(1,9) | let @i = "" | endfor
        > > >
        > > >You should use ":exe[cute]":
        > > >
        > > > au BufRead * for i in range(1,9) | exe "let @" . i . " = ''" | endfor
        > >
        > >
        > > In attempting to answer for this, I reached for
        > > curly-braces-expansion but discovered it didn't work as expected:
        > >
        > > :let i=3
        > > :let @{i}=''
        > > :echo @{i}
        > >
        > > returned an E18 (on the let) and an E15 (on the echo). If I issue
        > >
        > > :let i=3
        > > :let x{i}=42
        > > :echo x3
        > >
        > > it works as expected. Reading up at
        > >
        > > :help curly-braces-names
        > >
        > > doesn't give me much insight. Any takers to tell me it's a bug or
        > > point out my misunderstanding?
        >
        > Attached patch fixes it

        Well, it supports the curly-braces notation in a two more places. But I
        prefer to not further develop curly braces.

        It works with the :execute solution, right?


        --
        hundred-and-one symptoms of being an internet addict:
        146. You experience ACTUAL physical withdrawal symptoms when away
        from your 'puter and the net.

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      Your message has been successfully submitted and would be delivered to recipients shortly.