Tony wrote:

> On Thu, Apr 4, 2019 at 3:36 PM Bram Moolenaar <[email protected]> wrote:
> >
> >
> > Patch 8.1.1114
> > Problem:    Confusing overloaded operator "." for string concatenation.
> > Solution:   Add ".." for string concatenation.  Also "let a ..= b".
> > Files:      src/eval.c, src/testdir/test_eval_stuff.vim, 
> > runtime/doc/eval.txt
> 
> In the new version of doc/eval.txt (lines 1038-1039):
> 
> > For String concatenation ".." is preferred, since "." is ambiguous, it is 
> > also
> > used for |Dict| member access and floating point numbers.
> 
> For floating point numbers and (IIUC) for dictionary members, the dot
> should be used with no spaces around it.

I decided to not add restrictions/requirements for spacing at the same
time.  It's really a different discussion.  For example, I also don't
like:

        let a='asd'

There should be spaces to make it readable:

        let a = 'asd'

At the same time, for use with Dict members spaces might be useful:
        let m = getDict()
           \ .getSomething()
           \ .member

Without line concatenation the spaces would not be there.

Pehaps we can add some kind of Vim script lint for all that.

> If compatibility with earlier
> Vim versions is an issue (as e.g. in third-party plugins) I would
> recommend to always write the "concatenation dot" between spaces.
> OTOH, using a single name in a single namespace as both a String
> variable and a Dict is of course an error, but using .. for
> concatenation (when there are no overwhelming compatibility
> considerations) and . for Dict ownership would make that kind of error
> easier to spot.

See the patch for :scriptversion.  It might need some more work.

-- 
Some of the well known MS-Windows errors:
        EHUH            Unexpected error
        EUSER           User error, not our fault!
        EGOD            Horrible problem, god knows what has happened
        EERR            Errornous error: nothing wrong

 /// Bram Moolenaar -- [email protected] -- 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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui