On Monday, August 6, 2012 1:08:44 PM UTC-5, Bee wrote:
> On Aug 6, 8:48 am, Ben Fritz <fritzophre...@gmail.com> wrote:
>
> > let pattern='apples' " apples are healthy
>
> > let pattern.='\|bananas' " and bananas are delicious
>
>
>
> These do the same thing:
>
> let @/ = @/ . pad[c]
>
> let @/ .= pad[c]
>
>
>
> Is there an advantage (speed, space) to use one rather the other?
>
>
>
> Bill
I don't know the internals of Vim's implementation. It might be slightly faster to use "let var .= val" rather than "let var = var . val" because Vim might use extra resources to evaluate var before concatenating val in the latter, but conceptually they do the same thing and I have no reason no suspect there is a performance difference one way or the other. I just like using .= because it's less typing and makes for much shorter lines; especially when you use long variable names, or fields of a dictionary object or array items rather than regular variables.
--
You received this message from the "vim_use" 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
Monday, August 6, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment